public void CourseTracker_Resident_RequiredCourseFail() { /// 1.Navigate to the login page login as a AMA staff UserInfo role = UserUtils.GetUser(UserRole.Ama_Staff); LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser("10021373", "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); // Thread.Sleep(5000); string CourseTracker = Gcep.ResidentCourseTrackerLbl.Text; if (!CourseTracker.Contains("0")) { string[] CourseTrackernotNull = CourseTracker.Split(' '); //string[] countofcoursewasAssigned = CourseyrackernotNull[2].Split('/'); //string[] courseword = CourseTracker.Split(' '); int regCoursCount = Convert.ToInt16(CourseTrackernotNull[2]); //Thread.Sleep(5000); } else { string[] CoursetrackerwithNull = CourseTracker.Split(' '); int NoRegCourse = Convert.ToInt16(CoursetrackerwithNull[2]); } Gcep.ClickToAdvance(Gcep.SignOutLnk); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser(role.Username, role.Password); if (BrowserName == BrowserNames.Firefox) { Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled); } Gcep = ED.ClickToAdvance(ED.GcepLnk); /// 3.from Gcep navigating to institution managment searching for institution looking for curriculum and if their any curriculum with the same name deleting and starting create new curriculum. InstitutionsPage Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk); InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions("Ellis Hospital"); ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk); Program.UnassignCurriculum(); CurriculumMngPage Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk); Curriculum.Search("Learning111!!!"); Curriculum.DeleteCurriculum("Learning111!!!"); CurriculumCoursePage CurCoursPage = Curriculum.ClickToAdvance(Curriculum.CreateCurriculumTemplateBtn); /// 4.Form course page choosing available courses from table by index CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 8, 9, 10, 11, 12, 13, 14, 15, 16); }
public void CreateCurriculumTemplate() { string curriculumName = ""; if (BrowserName == BrowserNames.Chrome) { curriculumName = "Chrome1CurrName"; } if (BrowserName == BrowserNames.Firefox) { curriculumName = "FireFox1CurrName"; } if (BrowserName == BrowserNames.InternetExplorer) { curriculumName = "IE1CurrName"; } /// 1. Navigate to the login page login as a Manager or AMA staff UserInfo role = UserUtils.GetUser(UserRole.Ama_Staff); LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser(role.Username, role.Password); /// 2.click to CGEP link to navigate Gcep page and waiting load icon disappear GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk); /// 3. From GCEP click to curriculum template Link and Navigate curriculum management page and choose create curriculum template button and redirect to curriculum course page. CurriculumMngPage CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurriculumCoursePage CurCoursPage = CurTemp.ClickToAdvance(CurTemp.CreateCurriculumTemplateBtn); /// 4.Form course page choosing available courses from table by index CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 1, 7, 12); /// 5. Giving the name for curriculum passing parameter from TestCase as a string CurCoursPage.CurriculumNameTxt.Clear(); CurCoursPage.CurriculumNameTxt.SendKeys(curriculumName); /// 6.Saving curriculum and navigating to the pgy pages to assigne course to students PGYAssignmentPage PGY = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn); /// 7.Choosing student years to assign course by index for each course PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 1, 8); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 2, 7); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 3, 6); /// 8. Saving curriculum and navigating to curriculum management page again CurTemp = PGY.ClickToAdvance(PGY.SaveExitBtn); /// 9.Searching for curriculum what we created verifying its there and deleting. CurTemp.Search(curriculumName); CurTemp.DeleteCurriculum(curriculumName); Assert.IsTrue(CurTemp.NoRecordLabel.Displayed); // Thread.Sleep(5000); //PGY.ClickOnCellsOfRow(1, 9); //PGY.ClickOnCellsOfRow(2, 6, 7, 10); //PGY.ClickOnCellsOfRow(3, 6, 7); }
public void AssignmentAviability(string curriculumName, string curriculumName2) { /// 1.Navigate to the login page login as a Manager UserInfo role = UserUtils.GetUser(UserRole.Manager); LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser(role.Username, role.Password); /// 2.click to CGEP link navigate to Gcep page and waiting load icon disappear GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk); Thread.Sleep(9000); //until performance issue will be fix /// 3. From GCEP click to curriculum template Link and Navigate curriculum management page and searching for curriculum created by AMA CurriculumMngPage CurTempPage = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTempPage.Search(curriculumName); /// 4.Verifying Assign program is Enabled and Editing option is not there CurTempPage.Actioncell.Click(); var Actualvalue = CurTempPage.AssignToProgrammLnk.Text; Assert.IsTrue(CurTempPage.AssignToProgrammLnk.Enabled); Assert.AreNotEqual("Edit", Actualvalue); /// 5. Searching for second curriculum created by AMA CurTempPage.Search(curriculumName2); /// 6.Verifying Assign program is Enabled and Editing option is not there CurTempPage.Actioncell.Click(); var ActualvalueSecond = CurTempPage.AssignToProgrammLnk.Text; Assert.IsTrue(CurTempPage.AssignToProgrammLnk.Enabled); Assert.AreNotEqual("Edit", ActualvalueSecond); // Assert.IsTrue(CurTempPage.AssignToProgrammLnk.Enabled); // Assert.False(CurTempPage.Editcell.Displayed); // Assert.False(CurTempPage.Deletecell.Displayed); }
public void AssingCurriculum() //public void AssingCurriculum(string curriculumName) { string curriculumName = "new1111"; /// 1. Navigate to the login page and login as Manager ("10031315","password") UserInfo role = UserUtils.GetUser(UserRole.Manager); LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser(role.Username, role.Password); /// 2. click to CGEP link and waiting load icon disappear GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk); /// 3. From GCEP page click to curriculum template Link and Navigate curriculum management page and searching for curriculum created by AMA CurriculumMngPage CurTempPage = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTempPage.Search(curriculumName); /// 4.Clicking to Assign To Programm and redirecting Assign Program page CurTempPage.Actioncell.Click(); /// 5. Choosing starting date and ending date for program and clicking next button AssignProgramPage Assign = CurTempPage.ClickToAdvance(CurTempPage.AssignToProgrammLnk); string StartingDate = Assign.ChoosingStartDate(); string EndingDate = Assign.ChoosingEndDate(1, "M/d/yyyy"); AssignSummaryPage Summary = Assign.ClickToAdvance(Assign.NextBtn); /// 6. Verifying from Assign Summary page program is displayed Assert.IsTrue(Summary.CreatedProgramName.Displayed); Assert.AreEqual((Summary.CreatedProgramName.Text), curriculumName); Thread.Sleep(1000); /// 7.Verifying Assing confirmation test page curriculum name and starting date and ending dates are there which we choose. AssignConfirmationPage Confirmation = Summary.ClickToAdvance(Summary.NextBtn); Assert.IsTrue(Confirmation.Grid_CellTextFound(Confirmation.ProgramSummaryTbl, StartingDate + " - " + EndingDate)); //Confirmation.ConfirmBtn.Click(); }
public void MultyInstitution_CreatingCurriculum() { string curriculumName = ""; if (BrowserName == BrowserNames.Chrome) { curriculumName = "Chrome2CurrName"; } if (BrowserName == BrowserNames.Firefox) { curriculumName = "FireFox2CurrName"; } if (BrowserName == BrowserNames.InternetExplorer) { curriculumName = "IE2CurrName"; } /// 1.Navigate to the login page login as a Admin witn below credentials LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser("10016185", "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); Browser.WaitForElement(Bys.GCEPPage.InstitutionSelElem, ElementCriteria.IsEnabled); /// 3.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for Institution Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem)); string InstitutionName = GCEP.ReturnValueAfterSelectingInstitution(1); int FirstInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text); Browser.WaitForElement(Bys.GCEPPage.UserManageLnk, TimeSpan.FromSeconds(90), ElementCriteria.IsEnabled, ElementCriteria.IsVisible); /// 4.Clicking Curruculum template link creating curriculum with name depending on browser name CurriculumMngPage CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); if (Browser.FindElements(Bys.CurriculumMngPage.NoRecordLbl).Count > 0) { CurriculumCoursePage CurCoursPage = CurTemp.ClickToAdvance(CurTemp.CreateCurriculumTemplateBtn); HelperMethods.CurriculumCreationFlow(browser, curriculumName); } /// 5.Cliking to the the breadcrump with Institution name and naviagting GCEP page GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(InstitutionName); /// 6.Choosing second Institution from Dropdown and saving Institution name and count of users for Institution string secondInstutionName = GCEP.ReturnValueAfterSelectingInstitution(2); int SecondInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text); Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem)); /// 7.Clicking Curruculum template link searching for curriculum what we create for first Institution CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); /// 8. Verifiying curriculum not displayed for different Institution Assert.True(CurTemp.NoRecordLabel.Displayed); /// 9.Clicking breadcrump with second Institution name and navigating to GCEP page GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(secondInstutionName); /// 10.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for third Institution Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem)); string thirdInstitutionName = GCEP.ReturnValueAfterSelectingInstitution(3); int ThirdInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text); /// 11.Clicking Curruculum template link searching for curriculum what we create for first Institution CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); /// 12.Verifiying curriculum not displayed for a different Institution Assert.True(CurTemp.NoRecordLabel.Displayed); /// 13.Clicking breadcrump with third Institution name and navigating to GCEP page GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(thirdInstitutionName); /// 14.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for fourth Institution Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem)); string fourthInstitutionName = GCEP.ReturnValueAfterSelectingInstitution(4); int FourthInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text); /// 15.Clicking Curruculum template link searching for curriculum what we create for first Institution CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); /// 16.Verifiying curriculum not displayed for a different Institution Assert.True(CurTemp.NoRecordLabel.Displayed); /// 17.Clicking breadcrump with fourth Institution name and navigating to GCEP page GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(fourthInstitutionName); /// 18.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for fifth Institution Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem)); string fifthInstitutionName = GCEP.ReturnValueAfterSelectingInstitution(5); int FifthInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text); /// 19.Clicking Curruculum template link searching for curriculum what we create for first Institution CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); /// 20.Verifiying curriculum not displayed for a different Institution Assert.True(CurTemp.NoRecordLabel.Displayed); /// 21.Clicking breadcrump with fifth Institution name and navigating to GCEP page GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(fifthInstitutionName); /// 22. Choosing first Institution waiting for initialize page GCEP.InstitutionSelElem.SelectByText(InstitutionName); GCEP.WaitForInitialize(); /// 23.Clicking Curruculum template link searching for curriculum what we create for first Institution CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); /// 24. Deleting curriculum and verifying label is displayed CurTemp.DeleteCurriculum(curriculumName); Assert.IsTrue(CurTemp.NoRecordLabel.Displayed); /// 25.Verifying counts of user for each Institution not equal. Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount, SecondInstitutionUserCount, ThirdInstitutionUserCount, FourthInstitutionUserCount, FifthInstitutionUserCount)); //Assert.True(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount)); //Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, SecondInstitutionUserCount)); //Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount)); //Assert.True(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount)); }
public void TestCount() { string InstitutionName = "Temple University Hospital"; Browser.Navigate().GoToUrl("https://cme.ama-assn.org"); IWebElement ProdUserNameTxt = Browser.FindElement(By.Id("go_username")); IWebElement ProdPasswordTxt = Browser.FindElement(By.Id("go_password")); IWebElement ProdLoginBtn = Browser.FindElement(By.XPath("//input[@value='Sign In']")); ProdUserNameTxt.Clear(); ProdUserNameTxt.SendKeys("jpenderville"); ProdPasswordTxt.Clear(); ProdPasswordTxt.SendKeys("password1"); //div[@role='gridcell' and @ng-if='row.entity.Users > 0']/a ProdLoginBtn.Click(); EducationCenterPage ED = new EducationCenterPage(Browser); Browser.WaitForElement(Bys.EducationCenterPage.CourseTbl, ElementCriteria.IsEnabled, ElementCriteria.IsVisible); GCEPPage Gcep = ED.ClickToAdvance(ED.GcepLnk); int countOfCurriculumsOnGcep = Convert.ToInt32(Gcep.TotalCurriculumTmtsCountLnk.Text); int countOfTotalUsers = Convert.ToInt32(Gcep.TotalUsersCountLnk.Text); GCEPUserMngPage GUMP = Gcep.ClickToAdvance(Gcep.UserManageLnk); int CountOfUsersOnUserMngPage = GUMP.GetCountOfUsersFromUserManagementLabel(); Assert.AreEqual(countOfTotalUsers, CountOfUsersOnUserMngPage, "Counts of Users are not the same"); Gcep = GUMP.ClickToAdvance(GUMP.AdministrationLnk); CurriculumMngPage CMP = Gcep.ClickToAdvance(Gcep.CurriculumTemplatesLnk); int countofCurriculumTemplatesFromCurriculumTemplatesPage = CMP.GetCountOfCurriculumonTable("of", "items"); Assert.AreEqual(countOfCurriculumsOnGcep, countofCurriculumTemplatesFromCurriculumTemplatesPage, "Count of Curriculum Templates are not equals on GCEP page with CurriculumMngPage"); Gcep = CMP.ClickToAdvance(CMP.AdministrationLnk); InstitutionsPage IP = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk); IP.Search(InstitutionName); string xPathVariableForUserCount = string.Format("//*[text()='{0}']/../../../../div/div[3]", InstitutionName); //div[@role='gridcell' and contains (text(),'')]/a[@ng-if='row.entity.Users > 0'] string xPathVariableForProgramCount = string.Format("//*[text()='{0}']/../../../../div/div[4]", InstitutionName); //div[@role='gridcell' and contains (text(),'')]/a[@ng-if='row.entity.Programs > 0'] int usersCountFromInstitutionsPage = Convert.ToInt32(Browser.FindElement(By.XPath(xPathVariableForUserCount)).Text); int programsCountFromInstitutionsPage = Convert.ToInt32(Browser.FindElement(By.XPath(xPathVariableForProgramCount)).Text); InstitutionsGCEPPage IGP = IP.SearchforInstitutions(InstitutionName); int usersCountFromInstitutionsGCEPPage = Convert.ToInt32(IGP.TotalUserCountLnk.Text); int programsCountFromInstitutionsGCEPPage = Convert.ToInt32(IGP.TotalProgramCountLnk.Text); // Assert.AreEqual(usersCountFromInstitutionsPage, usersCountFromInstitutionsGCEPPage, "Count of user are not equals on Institutions table with InstitutionGCEP page"); // Assert.AreEqual(programsCountFromInstitutionsPage, programsCountFromInstitutionsGCEPPage, "Count of programs are not equals on Institutions table with InstitutionGCEP page"); ProgramsPage PP = IGP.ClickToAdvance(IGP.InstitutionProgramManagmentLnk); int countsOfProgramsOnPP = PP.Grid_GetCountOfItemsOnTable("of", "items"); // Assert.AreEqual(programsCountFromInstitutionsPage, countsOfProgramsOnPP); IGP = PP.ClickToBreadCrumbContainerToReturnInsGCEP(InstitutionName); GUMP = IGP.ClickToAdvance(IGP.InstitutionUserManagementLnk); int CountOfUsersOnUserMngPageForIns = GUMP.GetCountOfUsersFromUserManagementLabel(); //Assert.AreEqual(usersCountFromInstitutionsPage, CountOfUsersOnUserMngPageForIns); Assert.True(DataUtils.intsEqual(usersCountFromInstitutionsPage, usersCountFromInstitutionsGCEPPage, CountOfUsersOnUserMngPageForIns)); Assert.True(DataUtils.intsEqual(countsOfProgramsOnPP, programsCountFromInstitutionsGCEPPage, programsCountFromInstitutionsPage)); Thread.Sleep(5000); }
public void CourseTracker_Resident_RequiredCoursePass() { /// 1.Navigate to the login page login as a AMA staff UserInfo role = UserUtils.GetUser(UserRole.Ama_Staff); LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser("10021373", "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); string CourseTracker = Gcep.ResidentCourseTrackerLbl.Text; if (!CourseTracker.Contains('/')) { if (!CourseTracker.Contains("0")) { string[] CourseTrackernotNull = CourseTracker.Split(' '); int regCoursCount = Convert.ToInt16(CourseTrackernotNull[3]); } else { string[] CoursetrackerwithNull = CourseTracker.Split(' '); int NoRegCourse = Convert.ToInt16(CoursetrackerwithNull[2]); } Gcep.ClickToAdvance(Gcep.SignOutLnk); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser(role.Username, role.Password); if (BrowserName == BrowserNames.Firefox) { Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled); } Gcep = ED.ClickToAdvance(ED.GcepLnk); /// 3.from Gcep navigating to institution managment searching for institution looking for curriculum and if their any curriculum with the same name deleting and starting create new curriculum. InstitutionsPage Instute1 = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk); InstitutionsGCEPPage InsGcep1 = Instute1.SearchforInstitutions("Ellis Hospital"); ProgramsPage Program1 = InsGcep1.ClickToAdvance(InsGcep1.InstitutionProgramManagmentLnk); Program1.UnassignCurriculum(); CurriculumMngPage Curriculum1 = InsGcep1.ClickToAdvance(InsGcep1.InstitutionCurriculumTmpLnk); Curriculum1.Search("Learning111!!!"); Curriculum1.DeleteCurriculum("Learning111!!!"); CurriculumCoursePage CurCoursPage = Curriculum1.ClickToAdvance(Curriculum1.CreateCurriculumTemplateBtn); /// 4.Form course page choosing available courses from table by index CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 8, 9, 10, 11, 12, 13, 14, 15, 16); // List<string> CourseNames = new List<string>(); List <string> CourseNames = CurCoursPage.GetTheNamesChoosenCourses(); int CountofCoursewasAssigned = CourseNames.Count; /// 5. Giving the name for curriculum passing parameter from TestCase as a string CurCoursPage.CurriculumNameTxt.Clear(); CurCoursPage.CurriculumNameTxt.SendKeys("Learning111!!!"); /// 6.Saving curriculum and navigating to the pgy pages to assigne course to students PGYAssignmentPage PGY = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn); /// 7.Choosing student years to assign course by index for each course PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 1, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 2, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 3, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 4, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 5, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 6, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 7, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 8, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 9, 4); /// 8. Saving curriculum and navigating to curriculum management page again PGY.ClickToAdvance(PGY.SaveExitBtn); /// 9.Finding curriculum what we create and assigning to the programm Curriculum1.Search("Learning111!!!"); Curriculum1.Actioncell.Click(); AssignProgramPage Assign = Curriculum1.ClickToAdvance(Curriculum1.AssignToProgrammLnk); /// 10.Choosing starting date and ending date for program and clicking next button string StartingDate = Assign.ChoosingStartDate(); string EndingDate = Assign.ChoosingEndDate(1, "MM/d/yyyy"); Assign.AssignProgramm(); AssignSummaryPage Summary = Assign.ClickToAdvance(Assign.NextBtn); /// 11.Verifying from Assign Summary page program is displayed Assert.IsTrue(Summary.CreatedProgramName.Displayed); Assert.AreEqual((Summary.CreatedProgramName.Text), "Learning111!!!"); /// 12.Verifying Assing confirmation test page curriculum name and starting date and ending dates are there which we choose. AssignConfirmationPage Confirmation = Summary.ClickToAdvance(Summary.NextBtn); // Assert.IsTrue(Confirmation.Grid_CellTextFound(Confirmation.ProgramSummaryTbl, StartingDate + " - " + EndingDate)); Thread.Sleep(0500); Confirmation.ConfirmBtn.Click(); /// 13.Signing out and Signing in as a Resindent counting required courses from myRequiredCourses Curriculum1.ClickToAdvance(Curriculum1.SignOutLnk); Thread.Sleep(2500); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser("10021373", "password");//10021375,10021377,21387 Gcep = ED.ClickToAdvance(ED.GcepLnk); //Assert.True(Gcep.VerificationOfChoosenCoursesAssignedForResident(browser, CourseNames), "Course count are not equal"); Thread.Sleep(2000); string CourseTrackerAfterAssignment = Gcep.ResidentCourseTrackerLbl.Text; string[] courseword2 = CourseTrackerAfterAssignment.Split(' '); //string[] countofcourses1 = courseword2[2].Split('/'); //string[] courseword = CourseTracker.Split(' '); int CountofcoursesOnResidentGcepaftercourseAssignment = Convert.ToInt16(courseword2[3]); Thread.Sleep(2000); int CountofcoursesOnResidentGcepaftercourseAssigmentCompleted = Convert.ToInt16(courseword2[2]); Thread.Sleep(2000); Assert.True(CountofcoursesOnResidentGcepaftercourseAssignment.Equals(CountofCoursewasAssigned)); } do { ElemSet.ScrollToElement(browser, Gcep.FaceBookLnk); }while (!Gcep.ResidentGcepShowElectiveCourseLnk.Displayed); ElemSet.ScrollToElement(browser, Gcep.ResidentCourseTrackerLbl); CourseTestPage Course = Gcep.ResidentStartCourseOrContinue(browser, "AUTOMATION_002"); Gcep = Course.TestPass(); do { ElemSet.ScrollToElement(browser, Gcep.FaceBookLnk); }while (!Gcep.ResidentGcepShowElectiveCourseLnk.Displayed); Assert.IsTrue(Gcep.VerificationCourseCompletion(browser, "AUTOMATION_002", "View Certificate"), "View Certificet button not visible"); string CourseTrackerAfterTestCompletion = Gcep.ResidentCourseTrackerLbl.Text; string[] courseword3 = CourseTrackerAfterTestCompletion.Split(' '); int CountOfCompletedRegCourseafterPassingTest = Convert.ToInt16(courseword3[2]); //int some = CountofcoursesOnResidentGcepaftercourseAssigmentCompleted + 1; //Assert.True(CountofcoursesOnResidentGcepaftercourseAssigmentCompleted + 1 == (CountOfCompletedRegCourseafterPassingTest)); Gcep.ClickToAdvance(Gcep.SignOutLnk); Thread.Sleep(2500); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser(role.Username, role.Password);//10021375,10021377,21387 Gcep = ED.ClickToAdvance(ED.GcepLnk); InstitutionsPage Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk); InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions("Ellis Hospital"); ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk); Program.UnassignCurriculum(); CurriculumMngPage Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk); Curriculum.Search("Learning111!!!"); Curriculum.DeleteCurriculum("Learning111!!!"); }
public void Manage_MultyProgram_CurriculumAssignmentFlow() { /// 1.Navigate to the login page login as a Manager UserInfo role = UserUtils.GetUser(UserRole.Manager); 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 CGEP link navigate to Gcep page and waiting load icon disappear GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk); Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled); /// 3.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for Institution Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem)); string ProgramName = GCEP.ReturnValueAfterSelectingProgram(1);// GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 1); int firstProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text); /// 4.Clicking Curruculum template link and getting breadcrump text and verifying with program name CurriculumMngPage CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); // var value = Browser.FindElement(Bys.AMAPage.BreadCrump).Text; string expectedFromCM = CM.GetBreadCrumbContainerText(); Assert.IsTrue(expectedFromCM.Contains(ProgramName.ToLower())); string breadCrumpAfterAssigment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111"); Assert.True(breadCrumpAfterAssigment.Contains(ProgramName.ToLower())); Thread.Sleep(2000); /// 5.Clicking to the the breadcrump with Program name and naviagting GCEP page GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(ProgramName); Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled); /// 6.Choosing second Program from Dropdown and saving Program name and count of users for program string secondProgramName = GCEP.ReturnValueAfterSelectingProgram(2); //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 2); int secondProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text); /// 7.Clicking Curruculum template link and getting breadcrump text for second Porgram and verifying with Program name CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); string secondexpectedFromCM = CM.GetBreadCrumbContainerText(); Assert.IsTrue(secondexpectedFromCM.Contains(secondProgramName.ToLower())); string secondBreadcrumpAfterAssignment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111"); Assert.True(secondBreadcrumpAfterAssignment.Contains(secondProgramName.ToLower())); Thread.Sleep(2000); /// 8.Cliking to the the breadcrump with second Program name and naviagting GCEP page and getting breadcrump text for third Porgram GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(secondProgramName); Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled); string thirdProgramName = GCEP.ReturnValueAfterSelectingProgram(3); //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 3); int thirdProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text); Thread.Sleep(2000); /// 9.Clicking Curruculum template link and verifying with third Program name CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); string thirdexpectedFromCM = CM.GetBreadCrumbContainerText(); Assert.IsTrue(thirdexpectedFromCM.Contains(thirdProgramName.ToLower())); string thirdBreadcrumpAfterAssignment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111"); Assert.True(thirdBreadcrumpAfterAssignment.Contains(thirdProgramName.ToLower())); Thread.Sleep(2000); GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(thirdProgramName); Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled); /// 10.Verifying each program has different count of users. Assert.False(DataUtils.intsEqual(firstProgramUserCount, secondProgramUserCount, thirdProgramUserCount)); }
public void MultyProgram_CreatingCurriculum_Flow() { string curriculumName = ""; if (BrowserName == BrowserNames.Chrome) { curriculumName = "Chrome3CurrName"; } if (BrowserName == BrowserNames.Firefox) { curriculumName = "FireFox3CurrName"; } if (BrowserName == BrowserNames.InternetExplorer) { curriculumName = "IE3CurrName"; } /// 1.Navigate to the login page login as a Manager UserInfo role = UserUtils.GetUser(UserRole.Manager); 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 CGEP link navigate to Gcep page and waiting load icon disappear GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk); Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled); /// 3.Verifiying breadcrump is the same as a Program name saving Program name Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem)); string ProgramName = GCEP.ReturnValueAfterSelectingProgram(1); // GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 1); /// 4.Clicking Curruculum template link creating curriculum searching for curriculum if its not exist then creating curriculum with name depending on browser name CurriculumMngPage CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); if (Browser.FindElements(Bys.CurriculumMngPage.NoRecordLbl).Count > 0) { CurriculumCoursePage CurCoursPage = CurTemp.ClickToAdvance(CurTemp.CreateCurriculumTemplateBtn); HelperMethods.CurriculumCreationFlow(browser, curriculumName); } /// 5.Cliking to the the breadcrump with Program name and naviagting GCEP page GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(ProgramName); Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled); /// 6.Choosing second Program from Dropdown and saving Institution name string secondProgramName = GCEP.ReturnValueAfterSelectingProgram(2); //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 2); Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem)); Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled); //delete after performance issue removed /// 7.Clicking Curruculum template link searching for curriculum what we create for first Program CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); /// 8. Verifiying curriculum not displayed for different Program Assert.True(CurTemp.NoRecordLabel.Displayed); /// 9.Clicking breadcrump with second Program name and navigating to GCEP page GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(secondProgramName); Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled); /// 10.Verifiying breadcrump is the same as a Program name saving Program name for third Program Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem)); string thirdProgramName = GCEP.ReturnValueAfterSelectingProgram(3); //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 3); Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled); //delete after performance issue removed /// 11.Clicking Curruculum template link searching for curriculum what we create for first Program CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); /// 12. Verifiying curriculum not displayed for different Program Assert.True(CurTemp.NoRecordLabel.Displayed); /// 13.Clicking breadcrump with third Program name and navigating to GCEP page GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(thirdProgramName); Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled); /// 14. Choosing first Program from dropdown waiting for initialize page GCEP.ProgramSelElem.SelectByText(ProgramName); GCEP.WaitForInitialize(); Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem)); Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled); //delete after performance issue removed /// 15.Clicking Curruculum template link searching for curriculum what we create for first Program CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); CurTemp.Search(curriculumName); /// 16.Deleting curriculum and verifying label is displayed CurTemp.DeleteCurriculum(curriculumName); Assert.IsTrue(CurTemp.NoRecordLabel.Displayed); }
public void EditCurriculumTemplate() { string curriculumName = ""; string editedCurriculumName = ""; if (BrowserName == BrowserNames.Chrome) { curriculumName = "ChromeCurrName"; editedCurriculumName = "ChromeCurrNameEdited"; } if (BrowserName == BrowserNames.Firefox) { curriculumName = "FFCurrName"; editedCurriculumName = "FFCurrNameEdited"; } if (BrowserName == BrowserNames.InternetExplorer) { curriculumName = "IECurrName"; editedCurriculumName = "IECurrNameEdited"; } // string curriculum,string newcurriculum //newCurrName = DataUtils.GetRandomString(16); //editedCurrName = DataUtils.GetRandomString(16); /// 1. Navigate to the login page and login as AMA-staff("10031315","password") 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 CGEP link and waiting load icon disappear and landing on curriculum management page GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk); /// 3.on curriculum management page click curriculum templates link and landing curriculum course page CurriculumMngPage CurTempPage = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); /// 4. on curriculum courses page clicking create and choosing courses CurTempPage.Search(curriculumName); CurTempPage.DeleteCurriculum(curriculumName); CurriculumCoursePage CurCoursPage = CurTempPage.ClickToAdvance(CurTempPage.CreateCurriculumTemplateBtn); CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 1, 7, 12); /// 5.giving name for curriculum from Test cases parametr ("L2!") // string randomCurrName = DataUtils.GetRandomString(16); CurCoursPage.CurriculumNameTxt.Clear(); CurCoursPage.CurriculumNameTxt.SendKeys(curriculumName); /// 6. saving curriculum navigating pgy page PGYAssignmentPage PGYpage = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn); /// 7.choosing pgy's and saving // Assert.True(false); PGYpage.Grid_ClickElementWithoutTextInsideRow(PGYpage.CourseTbl, 1, 9); // PGYpage.ClickOnCellsOfRow(1, 9); PGYpage.Grid_ClickElementWithoutTextInsideRow(PGYpage.CourseTbl, 2, 4); //PGYpage.ClickOnCellsOfRow(2, 6, 7, 10); PGYpage.Grid_ClickElementWithoutTextInsideRow(PGYpage.CourseTbl, 3, 6); //PGYpage.ClickOnCellsOfRow(3, 6, 7); /// 8.saving curruculum navigating curriculum MNG page CurTempPage = PGYpage.ClickToAdvance(PGYpage.SaveExitBtn); /// 9.curriculum management page searching for curriculum what we created and saving name and row count choosing curriculum what we create and editing name and pgy years CurTempPage.Search(curriculumName); CurTempPage.CurriculumName.Click(); var ActualCurriculumName = CurTempPage.CurriculumName.Text; int ActualCurriculumCount = CurTempPage.GetCountofRow(CurTempPage.SpecificCurriculumTbl); CurTempPage.CurriculumWinClose.Click(); CurTempPage.EditCurriculum(curriculumName); /// 10. Adding new course CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 10); /// 11. Renaming curriculum from ("L2!"), to ("L3!"),curriculum name passing from test case attribute CurCoursPage.CurriculumNameTxt.Clear(); CurCoursPage.CurriculumNameTxt.SendKeys(editedCurriculumName); PGYpage = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn); /// 12. Choosing student years for new course what was added PGYpage.Grid_ClickElementWithoutTextInsideRow(PGYpage.CourseTbl, 3, 8); /// 13.Saving curriculum and navigating to curriculum management page again CurTempPage = PGYpage.ClickToAdvance(PGYpage.SaveExitBtn); /// 14. searching new created curriculum and saving info about it CurTempPage.Search(editedCurriculumName); CurTempPage.CurriculumName.Click(); var FinalCurriculumName = CurTempPage.CurriculumName.Text; int FinalCurriculumCount = CurTempPage.GetCountofRow(CurTempPage.SpecificCurriculumTbl); CurTempPage.CurriculumWinClose.Click(); /// 15.comparing first curriculum and second curriculum after editing Assert.IsFalse(FinalCurriculumCount == ActualCurriculumCount && FinalCurriculumName == ActualCurriculumName); /// 16.deleting last curriculum what we created and edited CurTempPage.DeleteCurriculum(editedCurriculumName); }
public void Resident_Pass_Test(string InstitutionName, string CurriculumName) { UserInfo role = UserUtils.GetUser(UserRole.Ama_Staff); LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser(role.Username, role.Password); /// 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 looking for curriculum and if their any curriculum with the same name deleting and starting create new curriculum. InstitutionsPage Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk); InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions(InstitutionName); ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk); Program.UnassignCurriculum(); CurriculumMngPage Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk); Curriculum.Search(CurriculumName); Curriculum.DeleteCurriculum(CurriculumName); CurriculumCoursePage CurCoursPage = Curriculum.ClickToAdvance(Curriculum.CreateCurriculumTemplateBtn); /// 4.Form course page choosing available courses from table by index CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 1, 4, 5); // List<string> CourseNames = new List<string>(); List <string> CourseNames = CurCoursPage.GetTheNamesChoosenCourses(); /// 5. Giving the name for curriculum passing parameter from TestCase as a string CurCoursPage.CurriculumNameTxt.Clear(); CurCoursPage.CurriculumNameTxt.SendKeys(CurriculumName); /// 6.Saving curriculum and navigating to the pgy pages to assigne course to students PGYAssignmentPage PGY = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn); /// 7.Choosing student years to assign course by index for each course PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 1, 5); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 2, 5); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 3, 5); /// 8. Saving curriculum and navigating to curriculum management page again PGY.ClickToAdvance(PGY.SaveExitBtn); /// 9.Finding curriculum what we create and assigning to the programm Curriculum.Search(CurriculumName); Curriculum.Actioncell.Click(); AssignProgramPage Assign = Curriculum.ClickToAdvance(Curriculum.AssignToProgrammLnk); /// 10.Choosing starting date and ending date for program and clicking next button string StartingDate = Assign.ChoosingStartDate(); string EndingDate = Assign.ChoosingEndDate(1, "MM/d/yyyy"); Assign.AssignProgramm(); AssignSummaryPage Summary = Assign.ClickToAdvance(Assign.NextBtn); /// 11.Verifying from Assign Summary page program is displayed Assert.IsTrue(Summary.CreatedProgramName.Displayed); Assert.AreEqual((Summary.CreatedProgramName.Text), CurriculumName); /// 12.Verifying Assing confirmation test page curriculum name and starting date and ending dates are there which we choose. AssignConfirmationPage Confirmation = Summary.ClickToAdvance(Summary.NextBtn); // Assert.IsTrue(Confirmation.Grid_CellTextFound(Confirmation.ProgramSummaryTbl, StartingDate + " - " + EndingDate)); Thread.Sleep(0500); Confirmation.ConfirmBtn.Click(); /// 13.Signing out and Signing in as a Resindent counting required courses from myRequiredCourses Curriculum.ClickToAdvance(Curriculum.SignOutLnk); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser("10021387", "password");//10021375,10021377,21387 Gcep = ED.ClickToAdvance(ED.GcepLnk); Assert.True(Gcep.VerificationOfChoosenCoursesAssignedForResident(browser, CourseNames), "Course count are not equal"); CourseTestPage Course = Gcep.ResidentStartCourseOrContinue(browser, CourseNames[1]); Gcep = Course.TestPass(); Assert.IsTrue(Gcep.VerificationCourseCompletion(browser, CourseNames[1], "View Certificate"), "View Certificet button not visible"); }
public void Resident_GCEP_SortBy_Duration() { /// 1.Navigate to the login page login as LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser("10031194", "password"); /// 2.click to GCEP link navigate to Gcep page and waiting load icon disappear GCEPPage Gcep = ED.ClickToAdvance(ED.GcepLnk); /// 3. Waiting to course tracker dislay and gennting count of courses if there is not any course assigned assign courses Browser.WaitForElement(Bys.GCEPPage.ResidentCourseTrackerLbl, TimeSpan.FromSeconds(120), ElementCriteria.IsVisible); string CourseTracker = Gcep.ResidentCourseTrackerLbl.Text; /// 4.Clicking to Sort By duration button and wait to page reload. Gcep.ResidentGCEPSortBYDurationBtn.Click(); Gcep.WaitForInitialize(); if (CourseTracker.Contains("0")) { Gcep.ClickToAdvance(Gcep.SignOutLnk); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser("10031315", "password"); Gcep = ED.ClickToAdvance(ED.GcepLnk); /// 3.from Gcep navigating to institution managment searching for institution looking for curriculum and if their any curriculum with the same name deleting and starting create new curriculum. InstitutionsPage Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk); InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions(""); ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk); Program.UnassignCurriculum(); CurriculumMngPage Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk); Curriculum.Search(""); Curriculum.DeleteCurriculum(""); CurriculumCoursePage CurCoursPage = Curriculum.ClickToAdvance(Curriculum.CreateCurriculumTemplateBtn); /// 4.Form course page choosing available courses from table by index CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 1, 8, 9); // List<string> CourseNames = new List<string>(); List <string> CourseNames = CurCoursPage.GetTheNamesChoosenCourses(); /// 5. Giving the name for curriculum passing parameter from TestCase as a string CurCoursPage.CurriculumNameTxt.Clear(); CurCoursPage.CurriculumNameTxt.SendKeys(""); /// 6.Saving curriculum and navigating to the pgy pages to assigne course to students PGYAssignmentPage PGY = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn); /// 7.Choosing student years to assign course by index for each course PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 1, 5); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 2, 5); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 3, 5); /// 8. Saving curriculum and navigating to curriculum management page again PGY.ClickToAdvance(PGY.SaveExitBtn); /// 9.Finding curriculum what we create and assigning to the programm Curriculum.Search(""); Curriculum.Actioncell.Click(); AssignProgramPage Assign = Curriculum.ClickToAdvance(Curriculum.AssignToProgrammLnk); /// 10.Choosing starting date and ending date for program and clicking next button string StartingDate = Assign.ChoosingStartDate(); string EndingDate = Assign.ChoosingEndDate(1, "MM/d/yyyy"); Assign.AssignProgramm(); AssignSummaryPage Summary = Assign.ClickToAdvance(Assign.NextBtn); /// 11.Verifying from Assign Summary page program is displayed Assert.IsTrue(Summary.CreatedProgramName.Displayed); Assert.AreEqual((Summary.CreatedProgramName.Text), ""); /// 12.Verifying Assing confirmation test page curriculum name and starting date and ending dates are there which we choose. AssignConfirmationPage Confirmation = Summary.ClickToAdvance(Summary.NextBtn); // Assert.IsTrue(Confirmation.Grid_CellTextFound(Confirmation.ProgramSummaryTbl, StartingDate + " - " + EndingDate)); Thread.Sleep(0500); Confirmation.ConfirmBtn.Click(); /// 13.Signing out and Signing in as a Resindent counting required courses from myRequiredCourses Curriculum.ClickToAdvance(Curriculum.SignOutLnk); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser("10021377", "password"); //10021375,10021377,21387 Gcep = ED.ClickToAdvance(ED.GcepLnk); //31224 } /// 5.Scrolling down to get all informartion about courses and verify that exploer elective course link displayed. do { ElemSet.ScrollToElement(browser, Gcep.FaceBookLnk); Thread.Sleep(1000); }while (!Gcep.ResidentGcepShowElectiveCourseLnk.Displayed); //while (j< countofCourse); Assert.True(Gcep.ResidentGcepShowElectiveCourseLnk.Displayed); /// 6.Getting all duration for courses and verifying its in ascending order Assert.True(Gcep.ResidentCourseCompareDuration()); }
public void Assignment_Flow() { string InstitutionName = "Ellis Hospital"; string CurriculumName = "CurriculumName1!"; /// 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 looking for curriculum and if their any curriculum with the same name deleting and starting create new curriculum. InstitutionsPage Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk); InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions(InstitutionName); CurriculumMngPage Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk); Curriculum.Search(CurriculumName); Curriculum.DeleteCurriculum(CurriculumName); CurriculumCoursePage CurCoursPage = Curriculum.ClickToAdvance(Curriculum.CreateCurriculumTemplateBtn); /// 4.Form course page choosing available courses from table by index CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 1, 7, 12); /// 5. Giving the name for curriculum passing parameter from TestCase as a string CurCoursPage.CurriculumNameTxt.Clear(); CurCoursPage.CurriculumNameTxt.SendKeys(CurriculumName); /// 6.Saving curriculum and navigating to the pgy pages to assigne course to students PGYAssignmentPage PGY = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn); /// 7.Choosing student years to assign course by index for each course PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 1, 4); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 2, 5); PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 3, 5); /// 8. Saving curriculum and navigating to curriculum management page again PGY.ClickToAdvance(PGY.SaveExitBtn); /// 9.Finding curriculum what we create and assigning to the programm Curriculum.Search(CurriculumName); Curriculum.Actioncell.Click(); AssignProgramPage Assign = Curriculum.ClickToAdvance(Curriculum.AssignToProgrammLnk); /// 10.Choosing starting date and ending date for program and clicking next button string StartingDate = Assign.ChoosingStartDate(); string EndingDate = Assign.ChoosingEndDate(1, "M/d/yyyy"); Assign.AssignProgramm(); AssignSummaryPage Summary = Assign.ClickToAdvance(Assign.NextBtn); /// 11.Verifying from Assign Summary page program is displayed Assert.IsTrue(Summary.CreatedProgramName.Displayed, "The curriculum name was not displayed"); Assert.AreEqual(CurriculumName, Summary.CreatedProgramName.Text, string.Format("The expected curriculum name {0} is not equal to the actual name {1}", Summary.CreatedProgramName.Text, CurriculumName)); /// 12.Verifying Assing confirmation test page curriculum name and starting date and ending dates are there which we choose. AssignConfirmationPage Confirmation = Summary.ClickToAdvance(Summary.NextBtn); Assert.IsTrue(Confirmation.Grid_CellTextFound(Confirmation.ProgramSummaryTbl, StartingDate + " - " + EndingDate)); Confirmation.ConfirmBtn.Click(); /// 13.Signing out and Signing in as a Resindent counting required courses from myRequiredCourses Curriculum.ClickToAdvance(Curriculum.SignOutLnk); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser("10021387", "password"); if (BrowserName == BrowserNames.Firefox) { Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled); } Gcep = ED.ClickToAdvance(ED.GcepLnk); // int startingCountCourse = Gcep.GetCountOfCourses(Gcep.MyRegiuredCourseTbl, Gcep.MyRequiredCourseLnk); //Gcep.MyRequiredCourseLnk.SendKeys(Keys.Tab); //Gcep.MyRequiredCourseLnk.Click(); //Thread.Sleep(0500); int startingCountCourse = Gcep.Grid_GetRowCount(Gcep.ResidentCourseTbl); /// 14.Signing out and Signing in as Admin or AMA_Staff lookingfor programm what we created and Unassigning Curriculum.ClickToAdvance(Curriculum.SignOutLnk); LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser(role.Username, role.Password); if (BrowserName == BrowserNames.Firefox) { Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled); } Gcep = ED.ClickToAdvance(ED.GcepLnk); Gcep.ClickToAdvance(Gcep.InstitutionManagLnk); Instute.SearchforInstitutions(InstitutionName); ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk); Program.UnassignCurriculum(); Gcep.ClickToAdvance(Gcep.SignOutLnk); // Curriculum.ClickToAdvance(Curriculum.SignOutLnk); /// 15.Signing out and Signing in as a Resindent counting required courses from myRequiredCourses LP = Navigation.GoToLoginPage(browser); ED = LP.LoginAsUser("10021387", "password"); if (BrowserName == BrowserNames.Firefox) { Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled); } Gcep = ED.ClickToAdvance(ED.GcepLnk); int finalCountCourse = Gcep.Grid_GetRowCount(Gcep.ResidentCourseTbl); //int finalCountCourse = Gcep.GetCountOfCourses(Gcep.MyRegiuredCourseTbl, Gcep.MyRequiredCourseLnk); /// 16.Verifiying that starting count does not match with final count courses after unassigning Assert.IsFalse(startingCountCourse == finalCountCourse, "Course count are equal"); }
public void Checking_AllCounts_FromGcep() { /// 1.Navigate to the login page with valid credentials below 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 CGEP link navigate to Gcep page and waiting load icon disappear and getting count of curriculum templates GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk); int countOfCurriculumTemplatesFromGCEP = Convert.ToInt32(GCEP.TotalCurriculumTmtsCountLnk.Text); /// 3.From GCEP Navigate to Curriculum Template saving count of curriculum on the table and verifying counts of curriculum from GCEP are equals CurriculumMngPage CMP = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk); int countofCurriculumTemplatesFromPage = CMP.GetCountOfCurriculumonTable("of", "items"); //string something = CMP.CountTableItemLbl.Text; //something = new string(something.Where(x => char.IsDigit(x)).ToArray()); Assert.AreEqual(countOfCurriculumTemplatesFromGCEP, countofCurriculumTemplatesFromPage); /// 4.Navigating back to GCEP if (BrowserName == BrowserNames.Firefox) { Browser.Navigate().Back(); } CMP.GMECompetencyEducationProgramLnk.Click(); //AdministrationLnk.Click(); GCEP.WaitForInitialize(); if (BrowserName == BrowserNames.Firefox) { Browser.WaitForElement(Bys.GCEPPage.InstitutionManagLnk, ElementCriteria.IsEnabled); } /// 5.from Gcep navigating to institution managment searching for institution InstitutionsPage Instute = GCEP.ClickToAdvance(GCEP.InstitutionManagLnk); InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions("Albert Einstein Medical Center"); /// 6.Saving counts of program,user,curriculum template from Institution GCEP int totalProgramCountonGCEP = Convert.ToInt32(InsGcep.TotalProgramCountLnk.Text); int totalUsersCountonGCEP = Convert.ToInt32(InsGcep.TotalUserCountLnk.Text); int totalCurTempCountonGCEP = Convert.ToInt32(InsGcep.TotalCurriculumTemplatesCountLnk.Text); /// 7.Navigating Program Management Page and getting counts of Programs Page and comparing countsof program from Institution GCEP page. ProgramsPage PP = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk); int countsOfProgramsOnPP = PP.Grid_GetCountOfItemsOnTable("of", "items"); Assert.AreEqual(totalProgramCountonGCEP, countsOfProgramsOnPP); /// 8.Navigating to Institution GCEP Page InsGcep = PP.ClickToBreadCrumbContainerToReturnInsGCEP("Albert Einstein Medical Center"); /// 9.From Instution GCEP clicking user management link and navigating GCEP User Management page getting counts of users from User Management table /// verifying counts of users count are equals from Institution GCEP and Users Management Page. GCEPUserMngPage GUMP = InsGcep.ClickToAdvance(InsGcep.InstitutionUserManagementLnk); int CountOfUsersOnUserMngPage = GUMP.GetCountOfUsersFromUserManagementLabel(); Assert.AreEqual(totalUsersCountonGCEP, CountOfUsersOnUserMngPage); /// 10.Navigating to Institution GCEP Page InsGcep = GUMP.ClickToBreadCrumbContainerToReturnInsGCEP("Albert Einstein Medical Center"); /// 11.From Institutiom GCEP clicking curriculum templates and navigating Curriculum Mng Page and getting count of curriculum templates and asserting /// counts of curriculum template from Institution GCEP page are equals. CMP = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk); int countOfCurTempFromCurrimMngPage = CMP.Grid_GetCountOfItemsOnTable("of", "items"); Assert.AreEqual(totalCurTempCountonGCEP, countOfCurTempFromCurrimMngPage); }