Exemple #1
0
        ///// <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.GCEPUserMngPage.UserLnk))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == UserLnk.GetAttribute("outerHTML"))
                {
                    UserLnk.Click();
                    Browser.WaitForElement(Bys.UserManagementPage.SaveBtn, TimeSpan.FromSeconds(120), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
                    new WebDriverWait(Browser, TimeSpan.FromSeconds(90)).Until(ExpectedConditions.UrlContains("users/manageuser"));
                    // Browser.SwitchTo().Frame(G.EnterACPDFrame);
                    return(new UserManagementPage(Browser));
                }
            }
            if (Browser.Exists(Bys.AMAPage.GMECompetencyEducationProgramLnk))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == GMECompetencyEducationProgramLnk.GetAttribute("outerHTML")) // GMECompetencyEducationProgramLnk.GetAttribute("outerHTML"))
                {
                    GMECompetencyEducationProgramLnk.SendKeys(Keys.Tab);                                                      // AdministrationLnk
                    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);
        }
Exemple #2
0
        /// <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.InstitutionsPage.EditInstitutionLnk))
            {
                if (buttonOrLinkElem.GetAttribute("id") == EditInstitutionLnk.GetAttribute("id"))
                {
                    EditInstitutionLnk.Click();
                    EditInstitutionPage EIP = new EditInstitutionPage(Browser);
                    EIP.WaitForInitialize();
                    return(EIP);
                }
            }
            if (Browser.Exists(Bys.AMAPage.AdministrationLnk))
            {
                if (buttonOrLinkElem.GetAttribute("id") == GMECompetencyEducationProgramLnk.GetAttribute("id")) // 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);
        }
        /// <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.DashboardNotificationsPage.CreateNotificationBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == CreateNotificationBtn.GetAttribute("outerHTML"))
                {
                    CreateNotificationBtn.Click();
                    //Browser.WaitForElement(Bys.NotificationCreatorPage.SaveExitBtn, TimeSpan.FromSeconds(120), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
                    //new WebDriverWait(Browser, TimeSpan.FromSeconds(90)).Until(ExpectedConditions.UrlContains("/add"));
                    NotificationCreatorPage NCP = new NotificationCreatorPage(Browser);
                    NCP.WaitForInitialize();
                    return(NCP);
                }
                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();
                        //new WebDriverWait(Browser, TimeSpan.FromSeconds(65)).Until(ExpectedConditions.UrlMatches("https://logintest.ama-assn.org/account/logout"));
                        return(this.Browser);
                    }
                }
                if (Browser.Exists(Bys.AMAPage.GMECompetencyEducationProgramLnk))
                {
                    if (buttonOrLinkElem.GetAttribute("outerHTML") == GMECompetencyEducationProgramLnk.GetAttribute("outerHTML"))
                    {
                        GMECompetencyEducationProgramLnk.Click();
                        //Browser.WaitForElement(Bys.NotificationCreatorPage.SaveExitBtn, TimeSpan.FromSeconds(120), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
                        //new WebDriverWait(Browser, TimeSpan.FromSeconds(90)).Until(ExpectedConditions.UrlContains("/add"));
                        GCEPPage GCEP = new GCEPPage(Browser);
                        GCEP.WaitForInitialize();
                        return(GCEP);
                    }
                }
                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);
        }
        /// <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.GMECompetencyEducationProgramLnk))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == GMECompetencyEducationProgramLnk.GetAttribute("outerHTML"))
                {
                    GMECompetencyEducationProgramLnk.Click();
                    GCEPPage GP = new GCEPPage(Browser);
                    GP.WaitForInitialize();
                    return(GP);
                }
            }
            // if (Browser.Exists(Bys.GCEPLibraryPage.BeginCourseBtn))
            // {
            //      if (buttonOrLinkElem.GetAttribute("outerHTML") == BeginCourseBtn.GetAttribute("outerHTML"))
            //      {
            //            BeginCourseBtn.Click();
            //            return new CourseTestPage(Browser);
            //      }
            // }

            //if (Browser.Exists(Bys.GCEPLibraryPage.TranscriptLnk))
            //{
            //    if (buttonOrLinkElem.GetAttribute("outerHTML") == TranscriptLnk.GetAttribute("outerHTML"))
            //    {
            //        TranscriptLnk.Click();
            //         Browser.WaitForElement(Bys.GCEPTranscriptPage.CompletedTestTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);

            //        return new GCEPTranscriptPage(Browser);
            //    }
            //}
            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);
        }
Exemple #5
0
        /// <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.GMECompetencyEducationProgramLnk))                                                 //AdministrationLnk
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == GMECompetencyEducationProgramLnk.GetAttribute("outerHTML")) // AdministrationLnk.GetAttribute("outerHTML"))
                {
                    GMECompetencyEducationProgramLnk.Click();                                                                 //AdministrationLnk.Click();
                    // Browser.WaitForElement(Bys.EducationCenterPage.MyCoursesTtl, TimeSpan.FromSeconds(60), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
                    //Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled);
                    // new WebDriverWait(Browser, TimeSpan.FromSeconds(90)).Until(ExpectedConditions.UrlContains("Courses.aspx"));

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