Exemplo n.º 1
0
        public void Take_Class_Register_And_Verify_Comments(string registerDate)
        {
            //Login and navigate to Take Register page
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.ClassTeacher);
            AutomationSugar.NavigateMenu("Tasks", "Attendance", "Take Register");

            //Search future class
            var takeRegisterTriplet = new TakeRegisterTriplet();

            takeRegisterTriplet.SearchCriteria.StartDate = registerDate;
            takeRegisterTriplet.SearchCriteria.Week      = true;
            takeRegisterTriplet.SearchCriteria.SelectYearGroup("Year 1");
            var takeRegisterDetail = takeRegisterTriplet.SearchCriteria.Search <TakeRegisterDetailPage>();

            var takeRegisterTable = takeRegisterDetail.Marks;
            IEnumerable <SchoolAttendanceCode> getANRs = Queries.GetAttendanceNotRequiredCodes();
            List <string> codes = getANRs.Select(x => x.Code).ToList <string>();

            if (codes.Contains(takeRegisterTable[0][1].Text))
            {
                Console.WriteLine("Marks can't be overwritten on Holidays");
                return;
            }

            //Select Overwrite  Mode
            takeRegisterDetail.ModePreserve     = false;
            takeRegisterDetail.Marks[0][1].Text = "L";

            //Add comment to cell
            takeRegisterDetail.Marks[0][1].Focus();
            takeRegisterDetail.Marks[0][1].OpenComment();
            var commentDialog = new AddCommentDialog();

            Wait.WaitLoading();
            commentDialog.Comment    = "Test Comment";
            commentDialog.MinuteLate = "100";
            commentDialog.ClickOk();

            //Check comment added
            takeRegisterDetail.Marks[0][2].Focus();
            takeRegisterDetail.Marks[0][1].Focus();
            takeRegisterDetail.Marks[0][1].OpenComment();
            commentDialog = new AddCommentDialog();
            Assert.AreEqual("Test Comment", commentDialog.Comment, "Comment is not saved");
            commentDialog.ClickOk();

            //Click Save
            takeRegisterDetail.ClickSave();

            //Check Message success display
            Assert.AreEqual(true, takeRegisterDetail.IsSuccessMessageDisplayed(), "Success message doesn't display");
        }
Exemplo n.º 2
0
        public void EditMarks_Register_Verify_Range_Of_functionalities(string dateSearch, string pupilForeName, string pupilSurName,
                                                                       string gender, string dateOfBirth, string DateOfAdmission, string YearGroup, string pupilName)
        {
            #region Pre-Conditions:

            // Navigate to Pupil Record
            DateTime dobSetup             = Convert.ToDateTime(dateOfBirth);
            DateTime dateOfAdmissionSetup = Convert.ToDateTime(DateOfAdmission);

            var learnerIdSetup   = Guid.NewGuid();
            var BuildPupilRecord = this.BuildDataPackage();

            BuildPupilRecord.CreatePupil(learnerIdSetup, pupilSurName, pupilForeName, dobSetup, dateOfAdmissionSetup, YearGroup);

            DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: BuildPupilRecord);

            #endregion

            #region TEST-STEPS
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            SeleniumHelper.NavigateQuickLink("Edit Marks");

            var editMarksTriplet = new EditMarksTriplet();
            editMarksTriplet.SearchCriteria.StartDate = dateSearch;
            editMarksTriplet.SearchCriteria.SelectYearGroup(YearGroup);
            var editMarkPage = editMarksTriplet.SearchCriteria.Search <EditMarksPage>();

            var editmarkTable = editMarkPage.Marks;
            IEnumerable <SchoolAttendanceCode> getANRs = Queries.GetAttendanceNotRequiredCodes();
            List <string> codes = getANRs.Select(x => x.Code).ToList <string>();

            if (codes.Contains(editmarkTable[1][2].Text))
            {
                Console.WriteLine("Marks can't be overwritten on Holidays");
                return;
            }

            //Verify the Preserve Mode Functionality
            //editMarkPage = editMarksTriplet.SearchCriteria.Search<EditMarksPage>();
            editMarkPage.ModePreserve = true;

            //Enter Marks using Keyboard and Ensure blank marks can be edited while 'preserve' is enabled.
            var preserveModeMark = editMarkPage.Marks[pupilName][2].Text = "C";

            //Mark should be changed For Blank Cells in Preserve Mode
            Assert.AreEqual(preserveModeMark, editMarkPage.Marks[pupilName][2].Value, "Mark is updated when modePreserve is true");

            editMarkPage.ClickSave();

            //Enter Marks using Keyboard and Ensure previously existing marks cannot be edited while 'preserve' is enabled.
            var newmark = editMarkPage.Marks[pupilName][2].Text = "B";
            Assert.AreNotEqual(newmark, editMarkPage.Marks[pupilName][2].Value, "Mark is updated when modePreserve is true");

            //Enter mark using the code Dropdown List
            editMarkPage.Marks[pupilName][2].Focus();
            editMarkPage.CodeList = "B";

            //Mark can not be changed
            Assert.AreNotEqual("B", editMarkPage.Marks[pupilName][2].Value, "Mark is updated when modePreserve is true");

            //Select Overwrite  Mode : Verify the Overwrite Mode Functionality
            editMarkPage.ModePreserve = false;

            //Ensure attendance marks can be entered using the keyboard
            var originalMark = editMarkPage.Marks[pupilName][2].Text = "A";

            //Mark changed in Overwrite Mode
            Assert.AreEqual(originalMark, editMarkPage.Marks[pupilName][2].Value, "Mark is not updated when ModeOverwrite is true");

            //Enter mark using the code Dropdown List
            editMarkPage.Marks[pupilName][2].Focus();
            editMarkPage.CodeList = "A";

            //Check value the mark changed
            Assert.AreEqual("A", editMarkPage.Marks[pupilName][2].Value, "Mark is not updated when ModeOverwrite is true");
            editMarkPage.ClickSave();

            // FloodFill data
            var markGridColumns = editMarkPage.Marks.Columns;
            markGridColumns[2].TimeIndicatorSelected = "AM";
            var floodFillMark = editMarkPage.CodeList = "L";
            editMarkPage.ClickSave();

            Assert.AreEqual(floodFillMark, editMarkPage.Marks[pupilName][2].Value, "The selected cells can not be flood filled");
            Assert.AreEqual(floodFillMark, editMarkPage.Marks[Convert.ToInt16(editMarkPage.Marks.RowCount / 2)][2].Value, "The selected cells can not be flood filled");
            Assert.AreEqual(floodFillMark, editMarkPage.Marks[Convert.ToInt16(editMarkPage.Marks.RowCount - 1)][2].Value, "The selected cells can not be flood filled");

            //Edit the mark with invalid value
            var inVaildMark = editMarkPage.Marks[pupilName][2].Text = "K";

            //VP: Value of mark can not be "abc"
            Assert.AreNotEqual(inVaildMark, editMarkPage.Marks[pupilName][2].Value, "The cell should not update 'K' value");

            //Add comment to cell
            editMarkPage.Marks[pupilName][2].Focus();
            editMarkPage.Marks[pupilName][2].OpenComment();
            var commentDialog = new AddCommentDialog();
            commentDialog.Comment    = "Test Comment";
            commentDialog.MinuteLate = "100";
            commentDialog.ClickOk();

            //Check comment added
            editMarkPage.Marks[pupilName][3].Focus();
            editMarkPage.Marks[pupilName][2].Focus();
            editMarkPage.Marks[pupilName][2].OpenComment();
            commentDialog = new AddCommentDialog();
            Assert.AreEqual("Test Comment", commentDialog.Comment, "Comment is not saved");
            commentDialog.ClickOk();

            //Click Save
            editMarkPage.ClickSave();

            //Check Message success display
            Assert.AreEqual(true, editMarkPage.IsSuccessMessageDisplayed(), "Success message doesn't display");

            #endregion
        }