Ejemplo n.º 1
0
        public void UncheckedCodesOnLookup_ShouldNotVisible_OnTakeRegister_CodeDropdown(string code)
        {
            LoginAndNavigate("Attendance Codes");

            AttendanceCodesLookupTriplet     searchPage = new AttendanceCodesLookupTriplet();
            AttendanceCodesLookupDetailsPage detailpage = searchPage.SearchCriteria.Search <AttendanceCodesLookupDetailsPage>();

            var gridRow = detailpage.AttendanceCodes.Rows.Single(x => x.Code == code);

            gridRow.AvailablefromTakeRegister = false;

            searchPage.ClickSave();

            SeleniumHelper.Logout();

            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.ClassTeacher);
            Wait.WaitForDocumentReady();
            AutomationSugar.NavigateMenu("Tasks", "Attendance", "Take Register");

            var takeRegisterTriplet = new TakeRegisterTriplet();

            takeRegisterTriplet.SearchCriteria.StartDate = SeleniumHelper.GetFirstDayOfWeek(DateTime.Now).ToShortDateString();
            takeRegisterTriplet.SearchCriteria.Week      = true;
            takeRegisterTriplet.SearchCriteria.SelectYearGroup("Year 1");
            var takeRegisterDetail = takeRegisterTriplet.SearchCriteria.Search <TakeRegisterDetailPage>();
            var takeRegisterTable  = takeRegisterDetail.Marks;

            var codeListFromDropdwon = takeRegisterDetail.GetCodeList();

            bool notFound = true;

            foreach (var Expectedcode in codeListFromDropdwon)
            {
                string[] test = Regex.Split(Expectedcode.Text, "-");
                if (test.Length > 0)
                {
                    if (test[0].Trim().ToUpper() == code)
                    {
                        notFound = false;
                    }
                }
            }

            Assert.IsTrue(notFound);

            #region Post-Condition
            SeleniumHelper.Logout();
            LoginAndNavigate("Attendance Codes");

            AttendanceCodesLookupTriplet     searchPage1 = new AttendanceCodesLookupTriplet();
            AttendanceCodesLookupDetailsPage detailpage1 = searchPage1.SearchCriteria.Search <AttendanceCodesLookupDetailsPage>();

            var gridRow1 = detailpage1.AttendanceCodes.Rows.Single(x => x.Code == code);

            gridRow1.AvailablefromTakeRegister = true;

            searchPage1.ClickSave();
            #endregion
        }
Ejemplo n.º 2
0
        public void Verify_CantUpdate_ANRCodes_OnLookup()
        {
            LoginAndNavigate("Attendance Codes");

            AttendanceCodesLookupTriplet searchPage = new AttendanceCodesLookupTriplet();

            AttendanceCodesLookupDetailsPage detailpage = searchPage.SearchCriteria.Search <AttendanceCodesLookupDetailsPage>();
            var lookUpCodes = detailpage.AttendanceCodes.Rows.Where(x => x.StatisticalMeaning == "Attendance not required" && x.AvailablefromTakeRegister == false).Select(x => x.Code).ToList();

            Assert.IsTrue(lookUpCodes.Count == 4);
        }
Ejemplo n.º 3
0
        public void Read_AttendanceCodes_Lookup_as_Admin(string code)
        {
            LoginAndNavigate("Attendance Codes");

            AttendanceCodesLookupTriplet searchPage = new AttendanceCodesLookupTriplet();

            searchPage.SearchCriteria.CodeOrDescription = code;
            AttendanceCodesLookupDetailsPage detailpage = searchPage.SearchCriteria.Search <AttendanceCodesLookupDetailsPage>();
            var gridRow = detailpage.AttendanceCodes.Rows.FirstOrDefault(x => x.Code == code);

            Assert.AreEqual(code, gridRow.Code);
        }
Ejemplo n.º 4
0
        public void Should_ModifyAndSave_AttendanceCodes_OnLookup(string code)
        {
            LoginAndNavigate("Attendance Codes");

            AttendanceCodesLookupTriplet     searchPage = new AttendanceCodesLookupTriplet();
            AttendanceCodesLookupDetailsPage detailpage = searchPage.SearchCriteria.Search <AttendanceCodesLookupDetailsPage>();

            var gridRow = detailpage.AttendanceCodes.Rows.Single(x => x.Code == code);

            gridRow.AvailablefromTakeRegister = false;

            searchPage.ClickSave();
            Assert.IsTrue(SharedComponents.CRUD.Detail.HasConfirmedSave());
        }
Ejemplo n.º 5
0
        public void Verify_AttendanceCodesCount_OnLookup()
        {
            LoginAndNavigate("Attendance Codes");

            AttendanceCodesLookupTriplet     searchPage = new AttendanceCodesLookupTriplet();
            AttendanceCodesLookupDetailsPage detailpage = searchPage.SearchCriteria.Search <AttendanceCodesLookupDetailsPage>();

            var lookUpCodes = detailpage.AttendanceCodes.Rows.Select(x => x.Code).ToList <string>();

            IEnumerable <SchoolAttendanceCode> allAttendanceCodes = Queries.GetAllAttendanceCodes();

            var results = allAttendanceCodes.Where(m => !lookUpCodes.Contains(m.Code)).ToList();

            Assert.IsTrue(results.Count == 0);
        }
Ejemplo n.º 6
0
        public void UncheckedCodesOnLookup_ShouldBeVisible_ForExistingMarks_OnTakeRegister(string dateSearch, string code, string YearGroup)
        {
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            SeleniumHelper.NavigateQuickLink("Edit Marks");

            var editMarksTriplet = new EditMarksTriplet();

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

            var editmarkTable = editMarkPage.Marks;

            if (editMarkPage.IsValidationMessageDisplay())
            {
                Console.WriteLine("It's Non-Working Day");
                return;
            }

            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 AttendanceNotRequiredCodes");
                return;
            }
            editMarkPage.ModePreserve     = false;
            editMarkPage.Marks[0][2].Text = code;
            editMarkPage.Marks[1][2].Text = code;
            editMarkPage.Marks[0][3].Text = code;
            editMarkPage.Marks[1][3].Text = code;

            editMarkPage.ClickSave();

            Wait.WaitForDocumentReady();

            AutomationSugar.NavigateMenu("Lookups", "Attendance", "Attendance Codes");

            AttendanceCodesLookupTriplet     searchPage = new AttendanceCodesLookupTriplet();
            AttendanceCodesLookupDetailsPage detailpage = searchPage.SearchCriteria.Search <AttendanceCodesLookupDetailsPage>();

            var gridRow = detailpage.AttendanceCodes.Rows.Single(x => x.Code == code);

            gridRow.AvailablefromTakeRegister = false;

            searchPage.ClickSave();

            SeleniumHelper.Logout();

            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.ClassTeacher);
            AutomationSugar.NavigateMenu("Tasks", "Attendance", "Take Register");

            var takeRegisterTriplet = new TakeRegisterTriplet();

            takeRegisterTriplet.SearchCriteria.StartDate = dateSearch;
            takeRegisterTriplet.SearchCriteria.Day       = true;
            takeRegisterTriplet.SearchCriteria.SelectYearGroup(YearGroup);
            var takeRegisterDetail = takeRegisterTriplet.SearchCriteria.Search <TakeRegisterDetailPage>();
            var takeRegisterTable  = takeRegisterDetail.Marks;

            IEnumerable <SchoolAttendanceCode> ANRs = Queries.GetAttendanceNotRequiredCodes();
            List <string> Codes = ANRs.Select(x => x.Code).ToList <string>();

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

            Assert.IsTrue(takeRegisterDetail.Marks[0][1].Text == code, "Codes are not Equal");
            Assert.IsTrue(takeRegisterDetail.Marks[0][2].Text == code, "Codes are not Equal");
            Assert.IsTrue(takeRegisterDetail.Marks[1][1].Text == code, "Codes are not Equal");
            Assert.IsTrue(takeRegisterDetail.Marks[1][2].Text == code, "Codes are not Equal");

            #region Post-Condition
            SeleniumHelper.Logout();
            LoginAndNavigate("Attendance Codes");

            AttendanceCodesLookupTriplet     searchPage1 = new AttendanceCodesLookupTriplet();
            AttendanceCodesLookupDetailsPage detailpage1 = searchPage1.SearchCriteria.Search <AttendanceCodesLookupDetailsPage>();

            var gridRow1 = detailpage1.AttendanceCodes.Rows.Single(x => x.Code == code);

            gridRow1.AvailablefromTakeRegister = true;

            searchPage1.ClickSave();
            #endregion
        }