/// <summary> /// Setting end date to sort calendars /// </summary> /// <param name="monthtoAdd"></param> /// <returns>date what we set calendar on stirng format</returns> public string SetEndDatForProgramm(int monthtoAdd) { AssignProgramPage ProgramPage = new AssignProgramPage(Browser); string assignedDay = ProgramPage.ChoosingEndDate(monthtoAdd, "MM/dd/yyyy"); return(assignedDay); }
/// <summary> /// on this method we are assigning curriculum to the program /// </summary> /// <param name="browser"></param> /// <param name="CurriculumName">curriculum name what we want to assign</param> /// <returns></returns> public static string CurriculumAssignmentFlow(IWebDriver browser, string CurriculumName) { CurriculumMngPage CMP = new CurriculumMngPage(browser); CMP.Search(CurriculumName); CMP.Actioncell.Click(); AssignProgramPage Assign = CMP.ClickToAdvance(CMP.AssignToProgrammLnk); string StartingDate = Assign.ChoosingStartDate(); string EndingDate = Assign.ChoosingEndDate(1, "MM/dd/yyyy"); AssignSummaryPage Summary = Assign.ClickToAdvance(Assign.NextBtn); AssignConfirmationPage Confirmation = Summary.ClickToAdvance(Summary.NextBtn); string breadCrumpafterASsignment = Confirmation.GetBreadCrumbContainerText(); return(breadCrumpafterASsignment); }
///// <summary> ///// Clicks the user-specified button or link and then waits for a window to close or open, or a page to load, ///// depending on the button that was clicked ///// </summary> ///// <param name="buttonOrLinkElem">The element to click on</param> public dynamic ClickToAdvance(IWebElement buttonOrLinkElem) { if (Browser.Exists(Bys.AMAPage.SignOutLnk)) { if (buttonOrLinkElem.GetAttribute("outerHTML") == SignOutLnk.GetAttribute("outerHTML")) { Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible); HeaderMenuDropDown.Click(); SignOutLnk.SendKeys(Keys.Tab); SignOutLnk.Click(); //Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible); // return new CurriculumMngPage(Browser); // new WebDriverWait(Browser, TimeSpan.FromSeconds(115)).Until(ExpectedConditions.UrlMatches("https://logintest.ama-assn.org/account/logout")); return(this.Browser); } } if (Browser.Exists(Bys.CurriculumMngPage.CurrulumTemplatesHeader)) { if (buttonOrLinkElem.GetAttribute("outerHTML") == CreateCurriculumTemplateBtn.GetAttribute("outerHTML")) { Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible); // new WebDriverWait(Browser, TimeSpan.FromSeconds(15)).Until(ExpectedConditions.UrlContains("gme-competency/admin/curriculumtemplates")); CreateCurriculumTemplateBtn.Click(); //Thread.Sleep(3000); //Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsEnabled); Browser.WaitForElement(Bys.CurriculumCoursePage.AvailableCoursesTbl, ElementCriteria.IsVisible); // new WebDriverWait(Browser, TimeSpan.FromSeconds(35)).Until(ExpectedConditions.UrlContains("gme-competency/admin/curriculumtemplates/course")); CurriculumCoursePage CCP = new CurriculumCoursePage(Browser); CCP.WaitForInitialize(); return(CCP); } } if (Browser.Exists(Bys.CurriculumMngPage.AssignToProgrammLnk)) { if (buttonOrLinkElem.GetAttribute("outerHTML") == AssignToProgrammLnk.GetAttribute("outerHTML")) { // Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible); // new WebDriverWait(Browser, TimeSpan.FromSeconds(15)).Until(ExpectedConditions.UrlContains("gme-competency/admin/curriculumtemplates")); // CurriculumMngPage.Actioncell.Click(); AssignToProgrammLnk.Click(); Browser.WaitForElement(Bys.AssignProgramPage.StartDateCalenderBox, TimeSpan.FromSeconds(240), ElementCriteria.IsVisible); // new WebDriverWait(Browser, TimeSpan.FromSeconds(35)).Until(ExpectedConditions.UrlContains("gme-competency/admin/curriculumtemplates/curriculumprogramtimeframe")); // Browser.SwitchTo().Frame(G.EnterACPDFrame); AssignProgramPage APP = new AssignProgramPage(Browser); APP.WaitForInitialize(); return(APP); } } if (Browser.Exists(Bys.AMAPage.AdministrationLnk)) { if (buttonOrLinkElem.GetAttribute("outerHTML") == GMECompetencyEducationProgramLnk.GetAttribute("outerHTML")) //AdministrationLnk.GetAttribute("outerHTML")) { GMECompetencyEducationProgramLnk.Click(); // AdministrationLnk.Click(); GCEPPage GP = new GCEPPage(Browser); GP.WaitForInitialize(); return(GP); } } else { throw new Exception("No button or link was found with your passed parameter. You either need to add this button to a new If statement, or if the button is already added, then the page you were on did not contain the button."); } return(null); }