Esempio n. 1
0
        public void Changing_CurriculumEndingDate()
        {
            string InstitutionName = "20170824_Institution";
            string ProgramName     = "Program 1";
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            ///  2.click to GCEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage Gcep = ED.ClickToAdvance(ED.GcepLnk);

            ///  3.from Gcep navigating to institution managment searching for institution
            InstitutionsPage     Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);
            InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions(InstitutionName);

            ///  4.From Institution Gcep Page going to Program Managment Page and searching for specific programm
            ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk);

            Program.Search(ProgramName);

            ///  5.Clicking edit program and navigating to Curriculum Course Page
            Program.ChoosingFromDate();
            CurriculumCoursePage CoursePage = Program.EditProgramm();

            ///  6.From Curriculum course page setting end date calender today date minus 1 month and verifying warning message
            string todayDateMinus = CoursePage.SetEndDatForProgramm(-1);

            Assert.IsTrue(CoursePage.CurrentDateWarningLbl.Displayed);

            ///  7.setting end date calender today date plus 36 month and verifying warning message
            string todayDatePlus = CoursePage.SetEndDatForProgramm(24);

            Assert.IsTrue(CoursePage.GreaterDateWarningLbl.Displayed);
            //Program.Selectselect("ins-admin-grid-action cursor-default ng-scope", "Edit Curriculum");

            ///  8.setting end date calender today date plus 9 month and clicking next buttton
            string assignedDate = CoursePage.SetEndDatForProgramm(10);

            ///  9.Navigating PGYAssignment Page clicking next button
            PGYAssignmentPage PGyPages = CoursePage.ClickToAdvance(CoursePage.NextBtn);

            ///  10.Navigating Assign Summary Page verifying Program naem displayed and next button clicking
            AssignSummaryPage Summary = PGyPages.ClickToAdvance(PGyPages.NextBtn);

            Assert.IsTrue(Summary.CreatedProgramName.Displayed);

            ///  11.Navigating Assign Confirmation Page clicking edit confirmation button
            AssignConfirmationPage ConfirmationPage = Summary.ClickToAdvance(Summary.NextBtn);

            Program = ConfirmationPage.ClickToAdvance(ConfirmationPage.EditConfirmBtn);

            ///  12.Navigating Institution Program Page searching for program and  verifying date what we changed is there
            Program.Search(ProgramName);
            Assert.IsTrue(Program.GetValueOfRow(Program.ProgramMngTbl, assignedDate));
        }
Esempio n. 2
0
        public void Update_BulkCurriculum(UserRole userRole)
        {
            string InstitutionName = "Beaumont Health System";
            ///  1. Navigate to the login page and login as a Admin
            UserInfo            role = UserUtils.GetUser(userRole);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            ///  2.click to GCEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage Gcep = ED.ClickToAdvance(ED.GcepLnk);

            ///  3.from Gcep navigating to institution managment searching for institution
            InstitutionsPage Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);

            ///  4.from institution page searching for specific institution choosing and navigating InstitutionGcep page
            InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions(InstitutionName);

            ///  5.Clicking program managment link and navigating Programs page, setting calendar for today date
            ProgramsPage PM = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk);

            PM.ChoosingFromDate();

            ///  6.Searching for specific program and if count of course on program less then 3 adding corsess else searching for second program also saving count of courses in variable.
            PM.Search("Anesthesiology");
            int AnesPC1 = PM.GetCountOfCourse();

            if (AnesPC1 < 3)
            {
                HelperMethods.AddCourseToCurriculum(browser);
            }
            PM.Search("Cardiology - Electrophysiology");
            int CardioPC2 = PM.GetCountOfCourse();

            //Assert.True(AnesPC1 == CardioPC2, "Count of courses for curriculum are not the same");

            /// 7.Searching for first program and removing to courses from it.
            PM.Search("Anesthesiology");
            CurriculumCoursePage CoursePage = PM.EditProgramm();

            CoursePage.AddOrRemoveCourses(CoursePage.ChosenCoursesTbl, CoursePage.RemoveSelectedBtn, 1, 2);
            PGYAssignmentPage      Pgy     = CoursePage.ClickToAdvance(CoursePage.NextBtn);
            AssignSummaryPage      Summary = Pgy.ClickToAdvance(Pgy.NextBtn);
            AssignConfirmationPage Confirm = Summary.ClickToAdvance(Summary.NextBtn);

            PM = Confirm.ClickToAdvance(Confirm.EditConfirmBtn);

            ///  8.Saving count of course after removing courses.
            PM.Search("Anesthesiology");
            int AnesPC1AfterRemoving = PM.GetCountOfCourse();

            ///  9.Clicking copy edit link and navigating copy edit page
            // Assert.AreNotEqual(AnesPC1, AnesPC1AfterRemoving);
            CopyCurriculumEditsPage CCEP = PM.CopyEditsProgramm();
            string TimeFrame             = CCEP.TimeFrameLbl.Text;

            ///  10.Verifying the program name are the same what we are searched for
            Assert.True(CCEP.ProgramNameLbl.Text.Equals("Anesthesiology"));
            int ActualCountOfprogramsBeforeEdit = CCEP.AddOrRemovePrograms(CCEP.CopyEditProgramTbl, 1);

            ///  11.After clicking next and copying course to other program verifying time fram are the same and verifying that copy same count of program
            Confirm = CCEP.ClickToAdvance(CCEP.NextBtn);
            Assert.True(TimeFrame.Equals(Confirm.TimeFrameLbl.Text));
            int ExpectedCountOfProgramsAfterEdit = Confirm.GetCountOfPrograms();

            Assert.True(ActualCountOfprogramsBeforeEdit == ExpectedCountOfProgramsAfterEdit);
            if (BrowserName == BrowserNames.Firefox)
            {
                Thread.Sleep(0500);
            }
            ///  12.clicking confirmation button navigating to the program page
            PM = Confirm.ClickToAdvance(Confirm.ConfirmBtn);

            ///  13.searching for second program and asserting courses from first program copied.
            PM.Search("Cardiology - Electrophysiology");
            int CountOfCourses2AfterCopy = PM.GetCountOfCourse();

            Assert.True(AnesPC1AfterRemoving == CountOfCourses2AfterCopy, "Count of courses after copy not equal,most likely test running parallel");

            ///  14. adding courses again to the program where we removed and copying for second program.
            PM.Search("Anesthesiology");
            HelperMethods.AddCourseToCurriculum(browser);
            int CountOfCoursesAfterAdding = PM.GetCountOfCourse();

            Assert.AreEqual(AnesPC1, CountOfCoursesAfterAdding, "count of courses are not the same in Curriculum");

            CCEP = PM.CopyEditsProgramm();
            int ActualCountOfprograms1 = CCEP.AddOrRemovePrograms(CCEP.CopyEditProgramTbl, 1);

            Confirm = CCEP.ClickToAdvance(CCEP.NextBtn);
            Thread.Sleep(1000);
            PM = Confirm.ClickToAdvance(Confirm.ConfirmBtn);
        }