Exemplo n.º 1
0
        /// <summary>
        /// this specific method adding courses to curriculum for specific program
        /// </summary>
        /// <param name="browser"></param>
        public static void AddCourseToCurriculum(IWebDriver browser)
        {
            ProgramsPage         PP         = new ProgramsPage(browser);
            CurriculumCoursePage CoursePage = PP.EditProgramm();

            CoursePage.AddOrRemoveCourses(CoursePage.AvailableCoursesTbl, CoursePage.AddSelectedBtn, 2, 3);
            PGYAssignmentPage Pgy = CoursePage.ClickToAdvance(CoursePage.NextBtn);

            Pgy.Grid_ClickElementWithoutTextInsideRow(Pgy.EditCoursePgyTbl, 2, 3);
            Pgy.Grid_ClickElementWithoutTextInsideRow(Pgy.EditCoursePgyTbl, 3, 3);
            AssignSummaryPage      Summary = Pgy.ClickToAdvance(Pgy.NextBtn);
            AssignConfirmationPage Confirm = Summary.ClickToAdvance(Summary.NextBtn);

            Confirm.ClickToAdvance(Confirm.EditConfirmBtn);
            PP.Search("Anesthesiology");
        }
Exemplo n.º 2
0
        /// <summary>
        /// basically creating curriculum all flow
        /// </summary>
        /// <param name="browser"></param>
        /// <param name="curriculumName">  curriculum name </param>
        public static void CurriculumCreationFlow(IWebDriver browser, string curriculumName)
        {
            CurriculumCoursePage CurCoursPage = new CurriculumCoursePage(browser);

            ///  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
            PGY.ClickToAdvance(PGY.SaveExitBtn);
            PGY.Search(curriculumName);
        }
        ///// <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.CurriculumCoursePage.NextBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == NextBtn.GetAttribute("outerHTML"))
                {
                    // ElemSet.ScrollToElement(Browser, buttonOrLinkElem);
                    NextBtn.Click();
                    //Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                    //Browser.WaitForElement(Bys.PGYAssignmentPage.UltimateTbl, TimeSpan.FromSeconds(120), ElementCriteria.IsEnabled,ElementCriteria.IsVisible);
                    // Browser.SwitchTo().Frame(G.EnterACPDFrame);
                    PGYAssignmentPage PGYAP = new PGYAssignmentPage(Browser);
                    PGYAP.WaitForInitialize();
                    return(PGYAP);
                }
            }

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