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); }