public void CheckLoading() { Browser.Navigate().GoToUrl("https://cme.ama-assn.org/gme-competency/"); 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"); ProdLoginBtn.Click(); GCEPPage GP = new GCEPPage(Browser); GP.WaitForInitialize(); InstitutionsPage IP = GP.ClickToAdvance(GP.InstitutionManagLnk); InstitutionsGCEPPage InsGcep = IP.SearchforInstitutions("Beaumont Health System (SEMCME)"); PromotePGYPage ProPGY = InsGcep.ClickToAdvance(InsGcep.InstitutionPromotePgyLnk); Thread.Sleep(8000); Assert.True(ProPGY.AvailableResidentsPromotePGYTblFirstRowChk.Displayed); //Thread.Sleep(3000); //Assert.False(ProPGY.AvailableResidentsPromotePGYTblFirstRowChk.Displayed); //Thread.Sleep(3000); //Assert.True(ProPGY.AvailableResidentsPromotePGYTblFirstRowChk.Displayed); }
public void PromotePGY() { /// 1. Navigate to the login page and login as a Admin LoginPage LP = Navigation.GoToLoginPage(browser); EducationCenterPage ED = LP.LoginAsUser("10013616", "password"); //10004610 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. Go to the promote pgy page and then add an availavle redisent to the selected list choosing different user for each browser. PromotePGYPage ProPGY = Gcep.ClickToAdvance(Gcep.PromotePGYLnk); if (BrowserName == BrowserNames.Firefox) { ProPGY.AddOrRemoveResidents(ProPGY.AvailableResidentsPromotePGYTbl, ProPGY.AddSelectedBtn, 1); } if (BrowserName == BrowserNames.Chrome) { ProPGY.AddOrRemoveResidents(ProPGY.AvailableResidentsPromotePGYTbl, ProPGY.AddSelectedBtn, 3); } if (BrowserName == BrowserNames.InternetExplorer) { ProPGY.AddOrRemoveResidents(ProPGY.AvailableResidentsPromotePGYTbl, ProPGY.AddSelectedBtn, 2); } /// 4. Grab the year value from the select table, open the form, and then assert that the New Year /// element's value increased 1 year from the tables value int chosenResidentsTableYearValue = Convert.ToInt32(ProPGY.Grid_GetValueOfCell(ProPGY.ChoosenResidentsPromotePGYTbl)); /// 5. Clicking promote button waiting to pop up appear getting name and new year what will be updated ProPGY.PromoteBtn.Click(); Browser.WaitForElement(Bys.PromotePGYPage.FormConfirmBtn, TimeSpan.FromSeconds(180), ElementCriteria.IsVisible, ElementCriteria.IsEnabled); int promotePGYFormNewYearValue = Convert.ToInt32(ProPGY.GetValueOfCell(ProPGY.FormResidentsDescriptionTbl, 2)); string Resident_FullName = ProPGY.GetValueOfCell(ProPGY.FormResidentsDescriptionTbl, 0); /// 6. Verifying new year are equals year value from choosen resident increase 1 year and clicking confirmation button Assert.AreEqual(chosenResidentsTableYearValue + 1, promotePGYFormNewYearValue); Gcep = ProPGY.ClickToAdvance(ProPGY.FormConfirmBtn); /// 7. After confirmation its getting Gcep page and clicking user managment link and searching for users by name what we promoted GCEPUserMngPage UMP = Gcep.ClickToAdvance(Gcep.UserManageLnk); // Extracting the first name from the resident to then search on first name var Resident_FirstAndLastName = Resident_FullName.Split(','); string Resident_LastName = Resident_FirstAndLastName[0]; UMP.Search(Resident_LastName); //IWebElement UserLnk1 = browser.FindElement(By.LinkText(Resident_FullName)); /// 8. Clicking on user and navigating User management page UserManagementPage UMPG = UMP.chooseUser(Resident_FullName); /// 9. Getting value as a year from user pgy and user name int userManagementPageYearValue = Convert.ToInt32(UMPG.UserPgySelElem.SelectedOption.Text); string Resident_Fullname_Expected = UMPG.UserNameTxt.GetAttribute("value"); /// 10. Verifying user pgy year equals to promote new year value and the user name with last name are the same Assert.AreEqual(userManagementPageYearValue, promotePGYFormNewYearValue); Assert.AreEqual(Resident_FullName, Resident_Fullname_Expected, "Resident name from available promote pgy table are not the same with user management page"); }