Exemple #1
0
        public void Resident_GCEP_SortBy_DueDate()
        {
            StringBuilder sb = new StringBuilder();
            ///  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;

            if (Browser.FindElements(Bys.GCEPPage.ResidentGcepShowElectiveCourseLnk).Count > 0)
            {
                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
                }

                ///  4.Scrolling down to get all informartion about courses and verify that explore elective course link displayed.
                do
                {
                    ElemSet.ScrollToElement(browser, Gcep.FaceBookLnk); Thread.Sleep(1000);
                }while (!Gcep.ResidentGcepShowElectiveCourseLnk.Displayed);
                Assert.True(Gcep.ResidentGcepShowElectiveCourseLnk.Displayed);

                ///  5.Getting all due date and verifying its in ascending order
                Assert.True(Gcep.ResidentCourseCompareDate());
            }
            else
            {
            }
        }