public void CourseTracker_Resident_RequiredCourseFail()
        {
            ///  1.Navigate to the login page login as a AMA staff
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser("10021373", "password");

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

            // Thread.Sleep(5000);
            string CourseTracker = Gcep.ResidentCourseTrackerLbl.Text;

            if (!CourseTracker.Contains("0"))
            {
                string[] CourseTrackernotNull = CourseTracker.Split(' ');
                //string[] countofcoursewasAssigned = CourseyrackernotNull[2].Split('/');
                //string[] courseword = CourseTracker.Split(' ');
                int regCoursCount = Convert.ToInt16(CourseTrackernotNull[2]);
                //Thread.Sleep(5000);
            }
            else
            {
                string[] CoursetrackerwithNull = CourseTracker.Split(' ');
                int      NoRegCourse           = Convert.ToInt16(CoursetrackerwithNull[2]);
            }
            Gcep.ClickToAdvance(Gcep.SignOutLnk);

            LP = Navigation.GoToLoginPage(browser);
            ED = LP.LoginAsUser(role.Username, role.Password);
            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            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("Ellis Hospital");

            ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk);

            Program.UnassignCurriculum();


            CurriculumMngPage Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk);

            Curriculum.Search("Learning111!!!");
            Curriculum.DeleteCurriculum("Learning111!!!");
            CurriculumCoursePage CurCoursPage = Curriculum.ClickToAdvance(Curriculum.CreateCurriculumTemplateBtn);

            ///  4.Form course page choosing available courses from table by index
            CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 8, 9, 10, 11, 12, 13, 14, 15, 16);
        }
예제 #2
0
        public void MultyInstitution_HelpPageVerification()
        {
            ///  1.Navigate to the login page login as Admin with availability manage multy Institutions
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser("10016185", "password");

            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.Saving all Institutions from drop down in list of strings and Sign Out
            List <string> institutions = ElemGet.SelElem_ListTextToListString(Gcep.InstitutionSelElem);

            Gcep.ClickToAdvance(Gcep.SignOutLnk);

            ///  4.Sign in again as Ama staff searching for all Institution what we saved on previous step.
            LP   = Navigation.GoToLoginPage(browser);
            ED   = LP.LoginAsUser(role.Username, role.Password);
            Gcep = ED.ClickToAdvance(ED.GcepLnk);
            InstitutionsPage IP = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);

            ///  5.Getting contact emails for each institution saving them and Sign out.
            List <string> institutionContactEmailAdress = new List <string>();

            institutionContactEmailAdress = HelperMethods.GetTheInstutionsEmail(Browser, institutions);

            ///  6.Login as Admin who manages multyple Institution choosing each Institution and comparing contact email adresses.
            // if(BrowserName == BrowserNames.InternetExplorer) { IP.HeaderMenuDropDown.SendKeys(Keys.Tab); }
            IP.HeaderMenuDropDown.Click();
            IP.SignOutLnk.Click();
            Thread.Sleep(2000);
            if (BrowserName == BrowserNames.InternetExplorer)
            {
                Thread.Sleep(2000);
            }
            LP   = Navigation.GoToLoginPage(browser);
            ED   = LP.LoginAsUser("10016185", "password");
            Gcep = ED.ClickToAdvance(ED.GcepLnk);
            HelpPage HP = Gcep.ClickToAdvance(Gcep.HelpfromYourInstitutionLnk);

            // HelpPage HP = Gcep.ClickToAdvance(Gcep.HelpLnk);

            ///  7.Verifiying emails are correct on help page for each Institution.
            //Assert.True(HP.AdministrationLnk.Displayed);
            //Assert.True(HP.AdminWatchVideoLnk.Displayed);
            Assert.IsTrue(HelperMethods.ComparingInstitutionEmailsWithHelpContactEmails(Browser, institutions, institutionContactEmailAdress));
        }
예제 #3
0
        public void Changing_CurriculumEndingDate()
        {
            string InstitutionName = "20170824_Institution";
            string ProgramName     = "Program 1";
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            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.from Gcep navigating to institution managment searching for institution
            InstitutionsPage     Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);
            InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions(InstitutionName);

            ///  4.From Institution Gcep Page going to Program Managment Page and searching for specific programm
            ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk);

            Program.Search(ProgramName);

            ///  5.Clicking edit program and navigating to Curriculum Course Page
            Program.ChoosingFromDate();
            CurriculumCoursePage CoursePage = Program.EditProgramm();

            ///  6.From Curriculum course page setting end date calender today date minus 1 month and verifying warning message
            string todayDateMinus = CoursePage.SetEndDatForProgramm(-1);

            Assert.IsTrue(CoursePage.CurrentDateWarningLbl.Displayed);

            ///  7.setting end date calender today date plus 36 month and verifying warning message
            string todayDatePlus = CoursePage.SetEndDatForProgramm(24);

            Assert.IsTrue(CoursePage.GreaterDateWarningLbl.Displayed);
            //Program.Selectselect("ins-admin-grid-action cursor-default ng-scope", "Edit Curriculum");

            ///  8.setting end date calender today date plus 9 month and clicking next buttton
            string assignedDate = CoursePage.SetEndDatForProgramm(10);

            ///  9.Navigating PGYAssignment Page clicking next button
            PGYAssignmentPage PGyPages = CoursePage.ClickToAdvance(CoursePage.NextBtn);

            ///  10.Navigating Assign Summary Page verifying Program naem displayed and next button clicking
            AssignSummaryPage Summary = PGyPages.ClickToAdvance(PGyPages.NextBtn);

            Assert.IsTrue(Summary.CreatedProgramName.Displayed);

            ///  11.Navigating Assign Confirmation Page clicking edit confirmation button
            AssignConfirmationPage ConfirmationPage = Summary.ClickToAdvance(Summary.NextBtn);

            Program = ConfirmationPage.ClickToAdvance(ConfirmationPage.EditConfirmBtn);

            ///  12.Navigating Institution Program Page searching for program and  verifying date what we changed is there
            Program.Search(ProgramName);
            Assert.IsTrue(Program.GetValueOfRow(Program.ProgramMngTbl, assignedDate));
        }
예제 #4
0
        public void UsersCount(UserRole userRole)
        {
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(userRole);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }

            ///  2.click to CGEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            if (userRole == UserRole.Manager)
            {
                Browser.WaitForElement(Bys.GCEPPage.SendEmailNotificationLnk, TimeSpan.FromSeconds(150), ElementCriteria.IsVisible);
            }

            ///  3.From GCEP page getting count of user from Users link and saving in Count of user integer then clicking user management link
            int             CountOfUserOnGCEP = Convert.ToInt32(GCEP.TotalUsersCountLnk.Text);
            GCEPUserMngPage GUMP = GCEP.ClickToAdvance(GCEP.UserManageLnk);

            ///  4.Getting count of user from user management label on user management page and verifying thatthey are equals.
            int CountOfUsersOnUserMngPage = GUMP.GetCountOfUsersFromUserManagementLabel();

            Assert.AreEqual(CountOfUserOnGCEP, CountOfUsersOnUserMngPage, "Counts of Users are not the same");
        }
예제 #5
0
        public void TestLoginPageandSignOutURL()
        {
            ///  1.Navigate to the login page
            UserInfo  role = UserUtils.GetUser(UserRole.Manager); //UserInfo role = UserUtils.GetUser(userRole);
            LoginPage LP   = Navigation.GoToLoginPage(browser);

            ///  2.Click the login button without entering in the username or password, and then verify the warning messages
            LP.LoginBtn.Click();
            browser.WaitForElement(Bys.LoginPage.UserNameWarningLbl, ElementCriteria.IsVisible);
            Assert.AreEqual("Please enter your username.", LP.UserNameWarningLbl.Text);

            ///  3. Login with a valid user credentials and navigate to GCEP page
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);
            GCEPPage            GCEP = ED.ClickToAdvance(ED.GcepLnk);

            ///  4.From GCEP  page Sign Out
            GCEP.HeaderMenuDropDown.Click();

            GCEP.SignOutLnk.SendKeys(Keys.Tab);
            GCEP.SignOutLnk.Click();
            Thread.Sleep(2000);

            ///  5.Verifying url after Sign Out.
            // Assert.IsTrue(Browser.Url.Equals("https://logintest.ama-assn.org/account/logout"));
        }
예제 #6
0
        public void ResidentPageGCEPPractice()
        {
            char[] delimitersChars = { '.', ',', '/' };

            LoginPage           LP = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED = LP.LoginAsUser("10021387", "password");
            StringBuilder       sb = new StringBuilder();
            ///  2.click to GCEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage Gcep          = ED.ClickToAdvance(ED.GcepLnk);
            string   CourseTracker = Gcep.ResidentCourseTrackerLbl.Text;

            if (!CourseTracker.Contains("0"))
            {
                string[]      courseword      = CourseTracker.Split(' ');
                string[]      countofcourses  = courseword[2].Split('/');
                int           completecourses = Convert.ToInt16(countofcourses[0]);
                int           totalcourses    = Convert.ToInt16(countofcourses[1]);
                List <string> something       = new List <string>(Browser.FindElements(By.XPath("//div[@class='activity-info-header margin-top-bottom-10']")).Select(iw => iw.Text));
                something.ForEach(somethings => sb.Append(somethings + '/'));
                String   about = sb.ToString();
                string[] words = about.Split(delimitersChars);
                Thread.Sleep(10000);
            }
            else
            {
                string[] courseword = CourseTracker.Split(' ');
                int      nocourses  = Convert.ToInt16(courseword[2]);
            }
        }
        public void CreateCurriculumTemplate()

        {
            string curriculumName = "";

            if (BrowserName == BrowserNames.Chrome)
            {
                curriculumName = "Chrome1CurrName";
            }
            if (BrowserName == BrowserNames.Firefox)
            {
                curriculumName = "FireFox1CurrName";
            }
            if (BrowserName == BrowserNames.InternetExplorer)
            {
                curriculumName = "IE1CurrName";
            }
            ///  1. Navigate to the login page login as a Manager or AMA staff
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            ///  2.click to CGEP link to navigate Gcep page and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            ///  3. From GCEP click to curriculum template Link and Navigate curriculum management page and choose create curriculum template button and redirect to curriculum course page.
            CurriculumMngPage    CurTemp      = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurriculumCoursePage CurCoursPage = CurTemp.ClickToAdvance(CurTemp.CreateCurriculumTemplateBtn);

            ///  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
            CurTemp = PGY.ClickToAdvance(PGY.SaveExitBtn);

            ///  9.Searching for curriculum what we created verifying its there and deleting.
            CurTemp.Search(curriculumName);
            CurTemp.DeleteCurriculum(curriculumName);
            Assert.IsTrue(CurTemp.NoRecordLabel.Displayed);
            // Thread.Sleep(5000);
            //PGY.ClickOnCellsOfRow(1, 9);
            //PGY.ClickOnCellsOfRow(2, 6, 7, 10);
            //PGY.ClickOnCellsOfRow(3, 6, 7);
        }
예제 #8
0
        public void InstitutionManagement(UserRole userRole)
        {
            //test = report.CreateTest("Institution Management");

            ///  1. Navigate to the login page and login as a Admin
            UserInfo            role = UserUtils.GetUser(userRole);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            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.Clicking User Management link  and navigating to Institution Management Page
            InstitutionsPage Institutions = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);

            ///  4.From action gear clicking to mark inactive and verifiying alert is generated by checking button aviability.
            Institutions.Select("ins-admin-action-active", "Mark Inactive");
            Thread.Sleep(0500);
            Assert.IsTrue(Institutions.AcceptBtn.Displayed);
            Institutions.DismissBtn.Click();

            ///  5.Searching for specicfic user and checking edit user enabled by clicking and verifying url and navigating back by clicking cancel button
            Institutions.Select("ins-admin-action-active", "Edit Institution");
            Thread.Sleep(0500);
            Assert.IsTrue(Browser.Url.Contains("update"));
            // ElemSet.ScrollToElement(Browser, Institutions.CancelBtn);
            Institutions.CancelBtn.Click();
            Institutions.WaitForInitialize();

            //test.Log(Status.Pass, "");
            //report.Flush();

            ///  6.From action gear clicking to create program and verifiying url is changed.
            Institutions.Select("ins-admin-action-active", "Create Program");
            Thread.Sleep(0500);
            Assert.IsTrue(Browser.Url.Contains("programs/add"));
            Institutions.CancelBtn.Click();

            //test.Log(Status.Pass, "");
            //report.Flush();
            //test.Log(Status.Fail, "");
            //report.Flush();
        }
        public void CourseTracker_Resident_ElectiveCoursePass()
        {
            ///  1.Navigate to the login page login as a AMA staff
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser("10021378", "password");

            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);
            string   CourseTracker = Gcep.ResidentCourseTrackerLbl.Text;

            string[] CourseyrackernotNull = CourseTracker.Split(' ');
            int      regCoursCount        = Convert.ToInt16(CourseyrackernotNull[3]);

            Gcep.ScrolltoGetAllCourses();

            string xPathVariable1 = string.Format("//div[@class='activity-info-name']/h4[.='{0}']/../../..//button", "Confidentiality");

            Thread.Sleep(0500);
            IWebElement button1 = browser.FindElement(By.XPath(xPathVariable1));

            ElemSet.ScrollToElement(browser, button1);

            // ElemSet.ScrollToElement(Browser, Browser.FindElement(By.LinkText("AMA TEST")));
            CourseTestPage Course = Gcep.ResidentStartCourseOrContinue(browser, "AUTOMATION_004");

            Gcep = Course.TestPass();
            Gcep.ScrolltoGetAllCourses();

            // Assert.IsTrue(Gcep.VerificationCourseCompletion(browser, "AUTOMATION_003", "View Certificate"), "View Certificet button not visible");

            string CourseTrackerAfterTestCompletion = Gcep.ResidentCourseTrackerLbl.Text;

            string[] courseword3 = CourseTrackerAfterTestCompletion.Split(' ');
            int      CountOfCompletedRegCourseafterPassingTest = Convert.ToInt16(courseword3[3]);

            Assert.True(regCoursCount + 1 == (CountOfCompletedRegCourseafterPassingTest));
        }
        public void CourseTracker_Resident_ElectiveCourseFail()
        {
            ///  1.Navigate to the login page login as a AMA staff
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser("10021378", "password");

            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);
            string   CourseTracker = Gcep.ResidentCourseTrackerLbl.Text;

            string[] CourseyrackernotNull = CourseTracker.Split(' ');
            int      regCoursCount        = Convert.ToInt16(CourseyrackernotNull[2]);
            int      countofRowNoScroll;
            int      countofRowFirstScroll;

            do
            {
                List <IWebElement> EnterRow = new List <IWebElement>(Browser.FindElements(By.XPath("//div[@class='activity-listing-bottom ng-scope']")));
                countofRowNoScroll = EnterRow.Count;
                //Thread.Sleep(1000);
                ElemSet.ScrollToElement(Browser, Gcep.FaceBookLnk);

                Thread.Sleep(1000);
                List <IWebElement> EnterRowFirstScroll1 = new List <IWebElement>(Browser.FindElements(By.XPath("//div[@class='activity-listing-bottom ng-scope']")));
                countofRowFirstScroll = EnterRowFirstScroll1.Count;
                Thread.Sleep(1000);
            }while (countofRowFirstScroll > countofRowNoScroll);

            //Assert.True(Gcep.VerificationOfChoosenCoursesAssignedForResident(browser, CourseNames), "Course count are not equal");

            string xPathVariable1 = string.Format("//div[@class='activity-info-name']/h4[.='{0}']/../../..//button", "content-2jpg");

            Thread.Sleep(0500);
            IWebElement button1 = browser.FindElement(By.XPath(xPathVariable1));

            ElemSet.ScrollToElement(browser, button1);
        }
예제 #11
0
        public void UserManagement()
        {
            ///  1.Navigate to the login page with valid credentials below
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            ///  2.click to CGEP link and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            ///  3.From CGEPPage clicking UsermngLnk
            if (BrowserName == BrowserNames.Chrome)
            {
                Browser.WaitForElement(Bys.GCEPPage.UserManageLnk, ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
            }
            GCEPUserMngPage UserManagePage = GCEP.ClickToAdvance(GCEP.UserManageLnk);


            ///  4.verifying Inactive user with below credentials
            UserManagePage.SearchForUserByStatusAndName("Inactive", "Emily");
            if (BrowserName == BrowserNames.Chrome)
            {
                Thread.Sleep(5000);
            }
            Assert.True(UserManagePage.Grid_CellTextFoundAMATest(UserManagePage.UsersManagementTbl, "Inactive"), "text on the grid is not what we expected");

            ///  5.verifying Active user with below credentials
            UserManagePage.SearchForUserByStatusAndName("Active", "Hamza");
            Assert.True(UserManagePage.Grid_CellTextFoundAMATest(UserManagePage.UsersManagementTbl, "Active"));

            /// 6.Verifying from User Management table that "Active" User ("Hamza") and with "Admin" Role Displayed
            UserManagePage.SearchForUserByRoleandStatusAndName("Admin", "Active", "Hamza");
            Assert.True(UserManagePage.Grid_CellTextFoundAMATest(UserManagePage.UsersManagementTbl, "Active"));

            ///  7.Verifying from User Management table that "Inactive" User ("Hamza") and with "Admin" Role is not Displayed
            UserManagePage.SearchForUserByRoleandStatusAndName("Admin", "Inactive", "Hamza");
            Assert.True(UserManagePage.NoRecorMatchLabel.Displayed, "No record Label is not displayed");
        }
예제 #12
0
        public void User_Management(UserRole userRole)
        {
            ///  1. Navigate to the login page and login as a Admin
            UserInfo            role = UserUtils.GetUser(userRole);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            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.Clicking User Management link  and navigating to User Management Page
            GCEPUserMngPage User = Gcep.ClickToAdvance(Gcep.UserManageLnk);

            ///  4.Searching for specicfic user and checking edit user enabled by clicking verifying url and navigating back by clicking cancel button
            User.SearchTxt.SendKeys("Aabo");
            Thread.Sleep(0500);
            User.Select("ins-admin-action-active", "Edit User");
            Thread.Sleep(0500);
            Assert.IsTrue(Browser.Url.Contains("users/manageuser"));
            User.CancelBtn.Click();

            ///  5.from action gear clicking to Send notification and verifying url and navigating back by clicking cancel button
            User.Select("ins-admin-action-active", "Send Notification");
            Thread.Sleep(0500);
            Assert.IsTrue(Browser.Url.Contains("users/sendnotification"));
            User.CancelSendBtn.Click();

            ///  6.from action gear clicking to mark inactive and verifiying alert is generated by checking button aviability.
            User.Select("ins-admin-action-active", "Mark Inactive");
            Thread.Sleep(0500);
            Assert.IsTrue(User.AcceptBtn.Displayed);
            User.DismissBtn.Click();
        }
        public void FilterEndedCurricula(string InstitutionName)
        {
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            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.from Gcep navigating to institution managment searching for institution
            InstitutionsPage     Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);
            InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions(InstitutionName);

            ///  4.From Institution Gcep Page going to Program Managment Page and searching for specific programm
            ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk);

            ///  5.Verifying date on calender set in default today date minus 6 month and seting calendar for today date
            Program.VeryfiyingDates();
            // Assert.IsFalse(Program.GetValueOfRow(Program.ProgramMngTbl, actualDateOnCalender));

            ///  6.Verifying from program management table ending date bigger then today date.
            Assert.IsTrue(Program.DateIsBiggerOrEqualsThenCurrentDate());

            //List<string> rowDates = new List<string>(Browser.FindElements(By.XPath("//*[@id='gridProgramManagement']//div[@class='ng-isolate-scope']/div[7]//div")).S‌​elect(iw => iw.Text));

            //foreach (string date in rowDates)
            //{
            //    DateTime currentDate = DateTime.Now;
            //    DateTime rowDate = Convert.ToDateTime(date);
            //    Assert.True(AssertUtils.DateGreaterThan(currentDate, rowDate));
            //}
        }
        public void AssignmentAviability(string curriculumName, string curriculumName2)
        {
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Manager);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            ///  2.click to CGEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            Thread.Sleep(9000); //until performance issue will be fix
            ///  3. From GCEP click to curriculum template Link and Navigate curriculum management page and searching for curriculum created by AMA
            CurriculumMngPage CurTempPage = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);

            CurTempPage.Search(curriculumName);

            ///  4.Verifying Assign program is Enabled and Editing option is not there
            CurTempPage.Actioncell.Click();
            var Actualvalue = CurTempPage.AssignToProgrammLnk.Text;

            Assert.IsTrue(CurTempPage.AssignToProgrammLnk.Enabled);
            Assert.AreNotEqual("Edit", Actualvalue);

            ///  5. Searching for second curriculum created by AMA
            CurTempPage.Search(curriculumName2);

            ///  6.Verifying Assign program is Enabled and Editing option is not there
            CurTempPage.Actioncell.Click();
            var ActualvalueSecond = CurTempPage.AssignToProgrammLnk.Text;

            Assert.IsTrue(CurTempPage.AssignToProgrammLnk.Enabled);
            Assert.AreNotEqual("Edit", ActualvalueSecond);

            // Assert.IsTrue(CurTempPage.AssignToProgrammLnk.Enabled);
            //  Assert.False(CurTempPage.Editcell.Displayed);
            //  Assert.False(CurTempPage.Deletecell.Displayed);
        }
예제 #15
0
        public void Resident_CompletedCourse_Listing()
        {
            ///  1.Navigate to the login page login as
            LoginPage           LP = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED = LP.LoginAsUser("10031198", "password");

            ///  2.click to GCEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage Gcep = ED.ClickToAdvance(ED.GcepLnk);

            ///  3.
            Gcep.ResidentGCEPCompletedSwitchBtn.Click();

            ///  4.Verifying transcript and certificate buttons are displayed.
            Assert.IsTrue(Gcep.ResidentGCEPTranscriptBtn.Displayed);
            Assert.IsTrue(Gcep.ResidentGCEPCertificatesDownloadBtn.Displayed);


            ///  5. Verifying completion dates are descending order.
            List <string> CompletionDateText    = new List <string>();
            List <string> CompletionDateTextRaw = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-xs-12 col-md-2 activity-status-action']/button/../span[@class='completed-date ng-binding']")).Select(iw => iw.Text));

            for (int i = 0; i < CompletionDateTextRaw.Count; i++)
            {
                CompletionDateText.Add(CompletionDateTextRaw[i].Remove(0, 11));
            }
            if (CompletionDateText.Count > 1)
            {
                for (int j = 0; j < CompletionDateText.Count - 1; j++)
                {
                    DateTime date     = Convert.ToDateTime(CompletionDateText[j]);
                    DateTime dateNext = Convert.ToDateTime(CompletionDateText[j + 1]);
                    Assert.True(AssertUtils.DateGreaterThanOrEquals(dateNext, date));
                    Assert.True(date >= dateNext);
                }
            }
        }
        public void AssingCurriculum()    //public void AssingCurriculum(string curriculumName)
        {
            string curriculumName = "new1111";
            ///  1. Navigate to the login page and login as Manager ("10031315","password")
            UserInfo            role = UserUtils.GetUser(UserRole.Manager);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            ///  2. click to CGEP link and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            ///  3. From GCEP page click to curriculum template Link and Navigate curriculum management page and searching for curriculum created by AMA
            CurriculumMngPage CurTempPage = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);

            CurTempPage.Search(curriculumName);

            ///  4.Clicking to Assign To Programm and redirecting Assign Program page
            CurTempPage.Actioncell.Click();

            ///  5. Choosing starting date and ending date for  program  and clicking next button
            AssignProgramPage Assign       = CurTempPage.ClickToAdvance(CurTempPage.AssignToProgrammLnk);
            string            StartingDate = Assign.ChoosingStartDate();
            string            EndingDate   = Assign.ChoosingEndDate(1, "M/d/yyyy");
            AssignSummaryPage Summary      = Assign.ClickToAdvance(Assign.NextBtn);

            ///  6. Verifying from Assign Summary page program is displayed
            Assert.IsTrue(Summary.CreatedProgramName.Displayed);
            Assert.AreEqual((Summary.CreatedProgramName.Text), curriculumName);
            Thread.Sleep(1000);

            ///  7.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));
            //Confirmation.ConfirmBtn.Click();
        }
예제 #17
0
        public void Resident_GCEP_SortBy_Progress()
        {
            ///  1.Navigate to the login page login as
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser("10031193", "password");

            ///  2.click to GCEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage Gcep = ED.ClickToAdvance(ED.GcepLnk);

            ///  3. Clicking resident sort by progrees button.
            Gcep.ResidentGCEPSortBYProgressBtn.Click();
            Gcep.WaitForInitialize();

            ///  4.Clicking to Sort By duration button and wait to page reload.
            do
            {
                ElemSet.ScrollToElement(browser, Gcep.FaceBookLnk);
            }while (!Gcep.ResidentGcepShowElectiveCourseLnk.Displayed);

            ///  5.Getting all progress information checking all conditions by AC#28

            Assert.True(Gcep.ResidentCourseProgressVerification(Gcep.ResidentCoutseStatusFailedLbl, Gcep.ResidentCourseStatusLockedLbl));
        }
        public void EditCurriculumTemplate()
        {
            string curriculumName       = "";
            string editedCurriculumName = "";

            if (BrowserName == BrowserNames.Chrome)
            {
                curriculumName       = "ChromeCurrName";
                editedCurriculumName = "ChromeCurrNameEdited";
            }
            if (BrowserName == BrowserNames.Firefox)
            {
                curriculumName       = "FFCurrName";
                editedCurriculumName = "FFCurrNameEdited";
            }
            if (BrowserName == BrowserNames.InternetExplorer)
            {
                curriculumName       = "IECurrName";
                editedCurriculumName = "IECurrNameEdited";
            }

            // string curriculum,string newcurriculum
            //newCurrName = DataUtils.GetRandomString(16);
            //editedCurrName = DataUtils.GetRandomString(16);

            ///  1. Navigate to the login page and login as  AMA-staff("10031315","password")
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }

            ///  2.click to CGEP link and waiting load icon disappear and landing on curriculum management page
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            ///  3.on curriculum management page click curriculum templates link and landing  curriculum course page
            CurriculumMngPage CurTempPage = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);

            ///  4. on curriculum courses page  clicking create and choosing courses
            CurTempPage.Search(curriculumName);
            CurTempPage.DeleteCurriculum(curriculumName);
            CurriculumCoursePage CurCoursPage = CurTempPage.ClickToAdvance(CurTempPage.CreateCurriculumTemplateBtn);

            CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 1, 7, 12);

            ///  5.giving name for curriculum from Test cases parametr ("L2!")
            // string randomCurrName = DataUtils.GetRandomString(16);
            CurCoursPage.CurriculumNameTxt.Clear();
            CurCoursPage.CurriculumNameTxt.SendKeys(curriculumName);

            ///  6. saving curriculum navigating pgy page
            PGYAssignmentPage PGYpage = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn);


            ///  7.choosing pgy's and saving
            //  Assert.True(false);
            PGYpage.Grid_ClickElementWithoutTextInsideRow(PGYpage.CourseTbl, 1, 9);                                         // PGYpage.ClickOnCellsOfRow(1, 9);
            PGYpage.Grid_ClickElementWithoutTextInsideRow(PGYpage.CourseTbl, 2, 4);                                         //PGYpage.ClickOnCellsOfRow(2, 6, 7, 10);
            PGYpage.Grid_ClickElementWithoutTextInsideRow(PGYpage.CourseTbl, 3, 6);                                         //PGYpage.ClickOnCellsOfRow(3, 6, 7);

            ///  8.saving curruculum navigating curriculum MNG page
            CurTempPage = PGYpage.ClickToAdvance(PGYpage.SaveExitBtn);

            ///  9.curriculum management page searching for curriculum what we created and saving name and  row count choosing curriculum what we create and editing name and pgy years
            CurTempPage.Search(curriculumName);
            CurTempPage.CurriculumName.Click();
            var ActualCurriculumName  = CurTempPage.CurriculumName.Text;
            int ActualCurriculumCount = CurTempPage.GetCountofRow(CurTempPage.SpecificCurriculumTbl);

            CurTempPage.CurriculumWinClose.Click();
            CurTempPage.EditCurriculum(curriculumName);

            ///  10. Adding new course
            CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 10);

            ///  11. Renaming curriculum from ("L2!"), to ("L3!"),curriculum name passing from test case attribute
            CurCoursPage.CurriculumNameTxt.Clear();
            CurCoursPage.CurriculumNameTxt.SendKeys(editedCurriculumName);
            PGYpage = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn);

            ///  12. Choosing student years for new course what was added
            PGYpage.Grid_ClickElementWithoutTextInsideRow(PGYpage.CourseTbl, 3, 8);

            ///  13.Saving curriculum and navigating to curriculum management page again
            CurTempPage = PGYpage.ClickToAdvance(PGYpage.SaveExitBtn);

            ///  14. searching new created curriculum and saving info about it
            CurTempPage.Search(editedCurriculumName);
            CurTempPage.CurriculumName.Click();
            var FinalCurriculumName  = CurTempPage.CurriculumName.Text;
            int FinalCurriculumCount = CurTempPage.GetCountofRow(CurTempPage.SpecificCurriculumTbl);

            CurTempPage.CurriculumWinClose.Click();

            ///  15.comparing first curriculum and second curriculum after editing
            Assert.IsFalse(FinalCurriculumCount == ActualCurriculumCount && FinalCurriculumName == ActualCurriculumName);

            ///  16.deleting last curriculum what we created and edited
            CurTempPage.DeleteCurriculum(editedCurriculumName);
        }
예제 #19
0
        public void Assignment_Flow()
        {
            string InstitutionName = "Ellis Hospital";
            string CurriculumName  = "CurriculumName1!";

            /// 1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            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.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(InstitutionName);
            CurriculumMngPage    Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk);

            Curriculum.Search(CurriculumName);
            Curriculum.DeleteCurriculum(CurriculumName);
            CurriculumCoursePage CurCoursPage = Curriculum.ClickToAdvance(Curriculum.CreateCurriculumTemplateBtn);

            ///  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, 4);
            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(CurriculumName);
            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, "M/d/yyyy");

            Assign.AssignProgramm();
            AssignSummaryPage Summary = Assign.ClickToAdvance(Assign.NextBtn);

            ///  11.Verifying from Assign Summary page program is displayed
            Assert.IsTrue(Summary.CreatedProgramName.Displayed, "The curriculum name was not displayed");
            Assert.AreEqual(CurriculumName, Summary.CreatedProgramName.Text, string.Format("The expected curriculum name {0} is not equal to the actual name {1}", Summary.CreatedProgramName.Text, CurriculumName));

            ///  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));
            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("10021387", "password");
            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            Gcep = ED.ClickToAdvance(ED.GcepLnk);
            // int startingCountCourse = Gcep.GetCountOfCourses(Gcep.MyRegiuredCourseTbl, Gcep.MyRequiredCourseLnk);
            //Gcep.MyRequiredCourseLnk.SendKeys(Keys.Tab);
            //Gcep.MyRequiredCourseLnk.Click();
            //Thread.Sleep(0500);
            int startingCountCourse = Gcep.Grid_GetRowCount(Gcep.ResidentCourseTbl);

            ///  14.Signing out and Signing in as Admin or AMA_Staff lookingfor programm what we created and Unassigning
            Curriculum.ClickToAdvance(Curriculum.SignOutLnk);
            LP = Navigation.GoToLoginPage(browser);
            ED = LP.LoginAsUser(role.Username, role.Password);
            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            Gcep = ED.ClickToAdvance(ED.GcepLnk);
            Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);
            Instute.SearchforInstitutions(InstitutionName);
            ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk);

            Program.UnassignCurriculum();
            Gcep.ClickToAdvance(Gcep.SignOutLnk);
            // Curriculum.ClickToAdvance(Curriculum.SignOutLnk);

            ///  15.Signing out and Signing in as a Resindent counting required courses from myRequiredCourses
            LP = Navigation.GoToLoginPage(browser);
            ED = LP.LoginAsUser("10021387", "password");
            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            Gcep = ED.ClickToAdvance(ED.GcepLnk);
            int finalCountCourse = Gcep.Grid_GetRowCount(Gcep.ResidentCourseTbl);

            //int finalCountCourse = Gcep.GetCountOfCourses(Gcep.MyRegiuredCourseTbl, Gcep.MyRequiredCourseLnk);

            ///  16.Verifiying that starting count does not match with final count courses after unassigning
            Assert.IsFalse(startingCountCourse == finalCountCourse, "Course count are equal");
        }
예제 #20
0
        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");
        }
예제 #21
0
        public void MultyInstitution_CreatingCurriculum()
        {
            string curriculumName = "";

            if (BrowserName == BrowserNames.Chrome)
            {
                curriculumName = "Chrome2CurrName";
            }
            if (BrowserName == BrowserNames.Firefox)
            {
                curriculumName = "FireFox2CurrName";
            }
            if (BrowserName == BrowserNames.InternetExplorer)
            {
                curriculumName = "IE2CurrName";
            }
            ///  1.Navigate to the login page login as a Admin witn below credentials
            LoginPage           LP = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED = LP.LoginAsUser("10016185", "password");

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

            Browser.WaitForElement(Bys.GCEPPage.InstitutionSelElem, ElementCriteria.IsEnabled);

            ///  3.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));
            string InstitutionName           = GCEP.ReturnValueAfterSelectingInstitution(1);
            int    FirstInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            Browser.WaitForElement(Bys.GCEPPage.UserManageLnk, TimeSpan.FromSeconds(90), ElementCriteria.IsEnabled, ElementCriteria.IsVisible);

            ///  4.Clicking Curruculum template link creating curriculum with name depending on browser name
            CurriculumMngPage CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);

            CurTemp.Search(curriculumName);
            if (Browser.FindElements(Bys.CurriculumMngPage.NoRecordLbl).Count > 0)
            {
                CurriculumCoursePage CurCoursPage = CurTemp.ClickToAdvance(CurTemp.CreateCurriculumTemplateBtn);
                HelperMethods.CurriculumCreationFlow(browser, curriculumName);
            }

            ///  5.Cliking to the the breadcrump with Institution name and naviagting GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(InstitutionName);

            ///  6.Choosing second Institution from  Dropdown and saving Institution name and count of users for Institution
            string secondInstutionName        = GCEP.ReturnValueAfterSelectingInstitution(2);
            int    SecondInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));

            ///  7.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  8. Verifiying curriculum not displayed for different Institution
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  9.Clicking breadcrump with second Institution name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(secondInstutionName);

            ///  10.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for third Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));
            string thirdInstitutionName      = GCEP.ReturnValueAfterSelectingInstitution(3);
            int    ThirdInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            ///  11.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  12.Verifiying curriculum not displayed for a different Institution
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  13.Clicking breadcrump with third Institution name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(thirdInstitutionName);

            ///  14.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for fourth Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));
            string fourthInstitutionName      = GCEP.ReturnValueAfterSelectingInstitution(4);
            int    FourthInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            ///  15.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  16.Verifiying curriculum not displayed for a different Institution
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  17.Clicking breadcrump with fourth Institution name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(fourthInstitutionName);

            ///  18.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for fifth Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));
            string fifthInstitutionName      = GCEP.ReturnValueAfterSelectingInstitution(5);
            int    FifthInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);


            ///  19.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  20.Verifiying curriculum not displayed for a different Institution
            Assert.True(CurTemp.NoRecordLabel.Displayed);


            ///  21.Clicking breadcrump with fifth Institution name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(fifthInstitutionName);

            ///  22. Choosing first Institution waiting for initialize page
            GCEP.InstitutionSelElem.SelectByText(InstitutionName);
            GCEP.WaitForInitialize();

            ///  23.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  24. Deleting curriculum and verifying label is displayed
            CurTemp.DeleteCurriculum(curriculumName);
            Assert.IsTrue(CurTemp.NoRecordLabel.Displayed);

            ///  25.Verifying counts of user for each Institution not equal.
            Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount, SecondInstitutionUserCount, ThirdInstitutionUserCount, FourthInstitutionUserCount, FifthInstitutionUserCount));
            //Assert.True(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount));
            //Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, SecondInstitutionUserCount));
            //Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount));
            //Assert.True(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount));
        }
        public void MemberBenefits()

        {
            ///  1. Navigate to the login page login as a Manager or AMA staff
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            ///  2.click to CGEP link to navigate Gcep page and waiting load icon disappear
            GCEPPage          GCEP = ED.ClickToAdvance(ED.GcepLnk);
            MemberBenefitPage MPG  = GCEP.ClickToAdvance(GCEP.MemberBenefitsManagementLnk);

            ElemSet.ScrollToElement(browser, MPG.FaceBookLnk);

            List <string> benefitTitlesAMAlevel_Published = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-lg-3 col-md-3 col-sm-3 col-xs-6 ng-scope']/span")).Select(ow => ow.Text));

            GCEP = MPG.ClickToAdvance(MPG.GMECompetencyEducationProgramLnk);
            GCEP.AdminSwitchBtn.Click();
            GCEP.WaitForInitialize();
            GCEP.ScrolltoGetAllCourses();
            ElemSet.ScrollToElement(Browser, GCEP.FaceBookLnk);

            List <string> benefitTitlesResidentlevel = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-lg-3 col-md-3 col-sm-3 col-xs-6 ng-scope']/span")).Select(ow => ow.Text));

            Assert.AreEqual(benefitTitlesAMAlevel_Published, benefitTitlesResidentlevel);



            GCEP.GMECompetencyEducationProgramLnk.Click();
            GCEP.WaitForInitialize();
            if (BrowserName == BrowserNames.InternetExplorer)
            {
                Browser.WaitForElement(Bys.GCEPPage.MemberBenefitsManagementLnk, TimeSpan.FromSeconds(90), ElementCriteria.IsEnabled);
            }

            MPG = GCEP.ClickToAdvance(GCEP.MemberBenefitsManagementLnk);
            List <string> benefitTitlesAMAlevel_Not_Published = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-lg-3 col-md-3 col-sm-3 col-xs-6 cross-sell-list-item ng-scope']/div[@class='margin-top-bottom-20 margin-bottom-15 ng-binding']")).Select(ow => ow.Text));

            if (benefitTitlesAMAlevel_Published.Count == benefitTitlesAMAlevel_Not_Published.Count)
            {
                MPG.TitleTxt.SendKeys("newBenefit");
                MPG.URLTxt.SendKeys("www.google.com");
                FileUtils.UploadFileUsingSendKeys(Browser, MPG.MembershipFormBrowseHiddenBtn, Bys.MemberBenefitPage.MembershipFormBrowseHiddenBtn, @"C:\upload\physician_save_0.jpg");
                MPG.SaveBtn.Click();
                MPG.WaitForInitialize();
            }
            ElemSet.ScrollToElement(Browser, MPG.PublishBtn);
            Thread.Sleep(500);
            MPG.PublishBtn.Click();
            MPG.WaitForInitialize();
            List <string> benefitTitlesAMAlevel_Published_firstTime = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-lg-3 col-md-3 col-sm-3 col-xs-6 ng-scope']/span")).Select(ow => ow.Text));

            GCEP = MPG.ClickToAdvance(MPG.GMECompetencyEducationProgramLnk);
            GCEP.ClickToAdvance(GCEP.SignOutLnk);

            LP   = Navigation.GoToLoginPage(browser);
            ED   = LP.LoginAsUser("10031198", "password");
            GCEP = ED.ClickToAdvance(ED.GcepLnk);

            GCEP.ScrolltoGetAllCourses();
            ElemSet.ScrollToElement(Browser, GCEP.FaceBookLnk);

            List <string> benefitTitlesResidentlevel_firstTime = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-lg-3 col-md-3 col-sm-3 col-xs-6 ng-scope']/span")).Select(ow => ow.Text));

            Assert.AreEqual(benefitTitlesAMAlevel_Published_firstTime, benefitTitlesResidentlevel_firstTime);
            // FileUtils.UploadFileUsingSendKeys(Browser, MPG.MembershipFormBrowseHiddenBtn, Bys.MemberBenefitPage.MembershipFormBrowseHiddenBtn, @"C:\upload\physician_save_0.jpg");
            // MPG.ChooseFileBtn.Click();

            GCEP.ClickToAdvance(GCEP.SignOutLnk);

            LP   = Navigation.GoToLoginPage(browser);
            ED   = LP.LoginAsUser(role.Username, role.Password);
            GCEP = ED.ClickToAdvance(ED.GcepLnk);
            MPG  = GCEP.ClickToAdvance(GCEP.MemberBenefitsManagementLnk);

            IWebElement benefitToDelete = Browser.FindElement(By.XPath("//div[@class = 'margin-top-bottom-20 margin-bottom-15 ng-binding' and contains (text(),'newBenefit')]/..//span[@class='glyphicon glyphicon-remove cursor-pointer']"));

            benefitToDelete.Click();
            Thread.Sleep(500);
            MPG.AcceptBtn.Click();
            MPG.WaitForInitialize();

            MPG.PublishBtn.Click();
            MPG.WaitForInitialize();


            List <string> benefitTitlesAMAlevel_Published_secondTime = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-lg-3 col-md-3 col-sm-3 col-xs-6 ng-scope']/span")).Select(ow => ow.Text));

            GCEP = MPG.ClickToAdvance(MPG.GMECompetencyEducationProgramLnk);
            GCEP.ClickToAdvance(GCEP.SignOutLnk);

            LP   = Navigation.GoToLoginPage(browser);
            ED   = LP.LoginAsUser("10031198", "password");
            GCEP = ED.ClickToAdvance(ED.GcepLnk);

            GCEP.ScrolltoGetAllCourses();
            ElemSet.ScrollToElement(Browser, GCEP.FaceBookLnk);

            List <string> benefitTitlesResidentlevel_secondTime = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-lg-3 col-md-3 col-sm-3 col-xs-6 ng-scope']/span")).Select(ow => ow.Text));

            Assert.AreEqual(benefitTitlesAMAlevel_Published_secondTime, benefitTitlesResidentlevel_secondTime);


            Thread.Sleep(15000);
        }
예제 #23
0
        public void TestCount()
        {
            string InstitutionName = "Temple University Hospital";

            Browser.Navigate().GoToUrl("https://cme.ama-assn.org");
            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");   //div[@role='gridcell' and @ng-if='row.entity.Users > 0']/a
            ProdLoginBtn.Click();
            EducationCenterPage ED = new EducationCenterPage(Browser);

            Browser.WaitForElement(Bys.EducationCenterPage.CourseTbl, ElementCriteria.IsEnabled, ElementCriteria.IsVisible);
            GCEPPage Gcep = ED.ClickToAdvance(ED.GcepLnk);

            int             countOfCurriculumsOnGcep = Convert.ToInt32(Gcep.TotalCurriculumTmtsCountLnk.Text);
            int             countOfTotalUsers        = Convert.ToInt32(Gcep.TotalUsersCountLnk.Text);
            GCEPUserMngPage GUMP = Gcep.ClickToAdvance(Gcep.UserManageLnk);
            int             CountOfUsersOnUserMngPage = GUMP.GetCountOfUsersFromUserManagementLabel();

            Assert.AreEqual(countOfTotalUsers, CountOfUsersOnUserMngPage, "Counts of Users are not the same");

            Gcep = GUMP.ClickToAdvance(GUMP.AdministrationLnk);
            CurriculumMngPage CMP = Gcep.ClickToAdvance(Gcep.CurriculumTemplatesLnk);
            int countofCurriculumTemplatesFromCurriculumTemplatesPage = CMP.GetCountOfCurriculumonTable("of", "items");

            Assert.AreEqual(countOfCurriculumsOnGcep, countofCurriculumTemplatesFromCurriculumTemplatesPage, "Count of Curriculum Templates are not equals on GCEP page with CurriculumMngPage");
            Gcep = CMP.ClickToAdvance(CMP.AdministrationLnk);
            InstitutionsPage IP = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);

            IP.Search(InstitutionName);
            string xPathVariableForUserCount         = string.Format("//*[text()='{0}']/../../../../div/div[3]", InstitutionName); //div[@role='gridcell' and contains (text(),'')]/a[@ng-if='row.entity.Users > 0']
            string xPathVariableForProgramCount      = string.Format("//*[text()='{0}']/../../../../div/div[4]", InstitutionName); //div[@role='gridcell' and contains (text(),'')]/a[@ng-if='row.entity.Programs > 0']
            int    usersCountFromInstitutionsPage    = Convert.ToInt32(Browser.FindElement(By.XPath(xPathVariableForUserCount)).Text);
            int    programsCountFromInstitutionsPage = Convert.ToInt32(Browser.FindElement(By.XPath(xPathVariableForProgramCount)).Text);

            InstitutionsGCEPPage IGP = IP.SearchforInstitutions(InstitutionName);
            int usersCountFromInstitutionsGCEPPage    = Convert.ToInt32(IGP.TotalUserCountLnk.Text);
            int programsCountFromInstitutionsGCEPPage = Convert.ToInt32(IGP.TotalProgramCountLnk.Text);

            // Assert.AreEqual(usersCountFromInstitutionsPage, usersCountFromInstitutionsGCEPPage, "Count of user are not equals  on Institutions table with InstitutionGCEP page");
            // Assert.AreEqual(programsCountFromInstitutionsPage, programsCountFromInstitutionsGCEPPage, "Count of programs are not equals on Institutions table with InstitutionGCEP page");

            ProgramsPage PP = IGP.ClickToAdvance(IGP.InstitutionProgramManagmentLnk);
            int          countsOfProgramsOnPP = PP.Grid_GetCountOfItemsOnTable("of", "items");

            // Assert.AreEqual(programsCountFromInstitutionsPage, countsOfProgramsOnPP);

            IGP  = PP.ClickToBreadCrumbContainerToReturnInsGCEP(InstitutionName);
            GUMP = IGP.ClickToAdvance(IGP.InstitutionUserManagementLnk);
            int CountOfUsersOnUserMngPageForIns = GUMP.GetCountOfUsersFromUserManagementLabel();

            //Assert.AreEqual(usersCountFromInstitutionsPage, CountOfUsersOnUserMngPageForIns);

            Assert.True(DataUtils.intsEqual(usersCountFromInstitutionsPage, usersCountFromInstitutionsGCEPPage, CountOfUsersOnUserMngPageForIns));
            Assert.True(DataUtils.intsEqual(countsOfProgramsOnPP, programsCountFromInstitutionsGCEPPage, programsCountFromInstitutionsPage));
            Thread.Sleep(5000);
        }
예제 #24
0
        public void Resident_GCEP_SortBy_Duration()
        {
            ///  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;

            ///  4.Clicking to Sort By duration button and wait to page reload.
            Gcep.ResidentGCEPSortBYDurationBtn.Click();
            Gcep.WaitForInitialize();

            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
            }

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

            ///  6.Getting all duration for courses and verifying its in ascending order
            Assert.True(Gcep.ResidentCourseCompareDuration());
        }
        public void CourseTracker_Resident_RequiredCoursePass()
        {
            ///  1.Navigate to the login page login as a AMA staff
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser("10021373", "password");

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


            string CourseTracker = Gcep.ResidentCourseTrackerLbl.Text;

            if (!CourseTracker.Contains('/'))
            {
                if (!CourseTracker.Contains("0"))
                {
                    string[] CourseTrackernotNull = CourseTracker.Split(' ');
                    int      regCoursCount        = Convert.ToInt16(CourseTrackernotNull[3]);
                }
                else
                {
                    string[] CoursetrackerwithNull = CourseTracker.Split(' ');
                    int      NoRegCourse           = Convert.ToInt16(CoursetrackerwithNull[2]);
                }
                Gcep.ClickToAdvance(Gcep.SignOutLnk);

                LP = Navigation.GoToLoginPage(browser);
                ED = LP.LoginAsUser(role.Username, role.Password);
                if (BrowserName == BrowserNames.Firefox)
                {
                    Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
                }
                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     Instute1 = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);
                InstitutionsGCEPPage InsGcep1 = Instute1.SearchforInstitutions("Ellis Hospital");

                ProgramsPage Program1 = InsGcep1.ClickToAdvance(InsGcep1.InstitutionProgramManagmentLnk);
                Program1.UnassignCurriculum();


                CurriculumMngPage Curriculum1 = InsGcep1.ClickToAdvance(InsGcep1.InstitutionCurriculumTmpLnk);
                Curriculum1.Search("Learning111!!!");
                Curriculum1.DeleteCurriculum("Learning111!!!");
                CurriculumCoursePage CurCoursPage = Curriculum1.ClickToAdvance(Curriculum1.CreateCurriculumTemplateBtn);

                ///  4.Form course page choosing available courses from table by index
                CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 8, 9, 10, 11, 12, 13, 14, 15, 16);

                // List<string> CourseNames = new List<string>();
                List <string> CourseNames = CurCoursPage.GetTheNamesChoosenCourses();


                int CountofCoursewasAssigned = CourseNames.Count;


                ///  5. Giving the name for curriculum passing parameter from TestCase as a string
                CurCoursPage.CurriculumNameTxt.Clear();
                CurCoursPage.CurriculumNameTxt.SendKeys("Learning111!!!");

                ///  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, 4);
                PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 2, 4);
                PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 3, 4);
                PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 4, 4);
                PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 5, 4);
                PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 6, 4);
                PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 7, 4);
                PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 8, 4);
                PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 9, 4);


                ///  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
                Curriculum1.Search("Learning111!!!");
                Curriculum1.Actioncell.Click();
                AssignProgramPage Assign = Curriculum1.ClickToAdvance(Curriculum1.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), "Learning111!!!");

                ///  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
                Curriculum1.ClickToAdvance(Curriculum1.SignOutLnk);

                Thread.Sleep(2500);
                LP   = Navigation.GoToLoginPage(browser);
                ED   = LP.LoginAsUser("10021373", "password");//10021375,10021377,21387
                Gcep = ED.ClickToAdvance(ED.GcepLnk);
                //Assert.True(Gcep.VerificationOfChoosenCoursesAssignedForResident(browser, CourseNames), "Course count are not equal");
                Thread.Sleep(2000);
                string   CourseTrackerAfterAssignment = Gcep.ResidentCourseTrackerLbl.Text;
                string[] courseword2 = CourseTrackerAfterAssignment.Split(' ');
                //string[] countofcourses1 = courseword2[2].Split('/');
                //string[] courseword = CourseTracker.Split(' ');
                int CountofcoursesOnResidentGcepaftercourseAssignment = Convert.ToInt16(courseword2[3]);

                Thread.Sleep(2000);
                int CountofcoursesOnResidentGcepaftercourseAssigmentCompleted = Convert.ToInt16(courseword2[2]);

                Thread.Sleep(2000);

                Assert.True(CountofcoursesOnResidentGcepaftercourseAssignment.Equals(CountofCoursewasAssigned));
            }
            do
            {
                ElemSet.ScrollToElement(browser, Gcep.FaceBookLnk);
            }while (!Gcep.ResidentGcepShowElectiveCourseLnk.Displayed);


            ElemSet.ScrollToElement(browser, Gcep.ResidentCourseTrackerLbl);

            CourseTestPage Course = Gcep.ResidentStartCourseOrContinue(browser, "AUTOMATION_002");


            Gcep = Course.TestPass();

            do
            {
                ElemSet.ScrollToElement(browser, Gcep.FaceBookLnk);
            }while (!Gcep.ResidentGcepShowElectiveCourseLnk.Displayed);

            Assert.IsTrue(Gcep.VerificationCourseCompletion(browser, "AUTOMATION_002", "View Certificate"), "View Certificet button not visible");

            string CourseTrackerAfterTestCompletion = Gcep.ResidentCourseTrackerLbl.Text;

            string[] courseword3 = CourseTrackerAfterTestCompletion.Split(' ');
            int      CountOfCompletedRegCourseafterPassingTest = Convert.ToInt16(courseword3[2]);

            //int some = CountofcoursesOnResidentGcepaftercourseAssigmentCompleted + 1;
            //Assert.True(CountofcoursesOnResidentGcepaftercourseAssigmentCompleted + 1 == (CountOfCompletedRegCourseafterPassingTest));
            Gcep.ClickToAdvance(Gcep.SignOutLnk);

            Thread.Sleep(2500);
            LP   = Navigation.GoToLoginPage(browser);
            ED   = LP.LoginAsUser(role.Username, role.Password);//10021375,10021377,21387
            Gcep = ED.ClickToAdvance(ED.GcepLnk);

            InstitutionsPage     Instute = Gcep.ClickToAdvance(Gcep.InstitutionManagLnk);
            InstitutionsGCEPPage InsGcep = Instute.SearchforInstitutions("Ellis Hospital");

            ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk);

            Program.UnassignCurriculum();

            CurriculumMngPage Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk);

            Curriculum.Search("Learning111!!!");
            Curriculum.DeleteCurriculum("Learning111!!!");
        }
예제 #26
0
        public void Resident_CourseListing_StartNow()
        {
            ///  1.Navigate to the login page login as
            LoginPage           LP = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED = LP.LoginAsUser("10030248", "password");//30248

            ///  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 to display and verifying all sort by buttons are displayed and enabled
            Browser.WaitForElement(Bys.GCEPPage.ResidentCourseTrackerLbl, TimeSpan.FromSeconds(120), ElementCriteria.IsVisible);
            Assert.True(Gcep.ResidentGCEPSortBYDueDateBtn.Displayed);
            Assert.True(Gcep.ResidentGCEPSortBYDurationBtn.Displayed);
            Assert.True(Gcep.ResidentGCEPSortBYProgressBtn.Displayed);


            ///  4.If Start Now button disabled then scrol down and click show elective courses
            if (Gcep.ResidentCouseStartNowBtn.GetAttribute("class").Contains("disabled"))
            {
                Gcep.ScrolltoGetAllCourses();
                Gcep.ResidentGcepShowElectiveCourseLnk.Click();
            }

            ///  5.Scrolling down and saving all courses headers.
            Gcep.ScrolltoGetAllCourses();
            List <string> courseTitlesByDueDate = new List <string>(Browser.FindElements(By.XPath("//div[@class='row activity-listing-row']//h4")).Select(iw => iw.Text));


            ///  6.Getting locked courses headers and comparing with all courses headers by due date if its matching removing locked courses headers
            List <string> lockedCourseTitlesByDueDate = new List <string>(Browser.FindElements(By.XPath(" //span[@class='locked']/../..//div[@class='activity-info-name']/h4")).Select(iw => iw.Text));

            if (lockedCourseTitlesByDueDate.Count > 0)
            {
                for (int i = 0; i < courseTitlesByDueDate.Count; i++)
                {
                    for (int j = 0; j < lockedCourseTitlesByDueDate.Count; j++)
                    {
                        if (courseTitlesByDueDate[i] == lockedCourseTitlesByDueDate[j])
                        {
                            courseTitlesByDueDate.Remove(courseTitlesByDueDate[i]);
                        }
                    }
                }
            }

            ///  7.Getting completed courses headers and comparing  with all courses headers by due date if its matching removing completed courses headers.
            List <string> completedCourseTitlesByDueDate = new List <string>(Browser.FindElements(By.XPath(" //span[@class='completed-date ng-binding']/../..//div[@class='activity-info-name']/h4")).Select(iw => iw.Text));

            if (completedCourseTitlesByDueDate.Count > 0)
            {
                for (int i = 0; i < courseTitlesByDueDate.Count; i++)
                {
                    for (int j = 0; j < completedCourseTitlesByDueDate.Count; j++)
                    {
                        if (courseTitlesByDueDate[i] == completedCourseTitlesByDueDate[j])
                        {
                            courseTitlesByDueDate.Remove(courseTitlesByDueDate[i]);
                        }
                    }
                }
            }

            ///  8.After removing locked courses and completed courses headers getting first course header and saving it.Then clicking start now button
            string firstCourseTitleByDueDate = courseTitlesByDueDate[0];

            ElemSet.ScrollToElement(Browser, Gcep.ResidentCourseTrackerLbl);
            CourseTestPage CTP = Gcep.ClickToAdvance(Gcep.ResidentCouseStartNowBtn);

            ///  9.getting course name header and comparing with our first course header what saved above and navigating back
            string startedCourseTitleByDueDate = CTP.CourseTitleLbl.Text;

            Assert.AreEqual(firstCourseTitleByDueDate, startedCourseTitleByDueDate);
            Browser.Navigate().Back();
            Gcep.WaitForInitialize();

            Gcep.ResidentGCEPSortBYDurationBtn.Click();
            Gcep.WaitForInitialize();
            if (Gcep.ResidentCouseStartNowBtn.GetAttribute("class").Contains("disabled"))
            {
                Gcep.ScrolltoGetAllCourses();
                Gcep.ResidentGcepShowElectiveCourseLnk.Click();
            }

            Gcep.ScrolltoGetAllCourses();

            List <string> courseTitlesByDuration = new List <string>(Browser.FindElements(By.XPath("//div[@class='row activity-listing-row']//h4")).Select(iw => iw.Text));

            List <string> lockedCourseTitlesByDuration = new List <string>(Browser.FindElements(By.XPath(" //span[@class='locked']/../..//div[@class='activity-info-name']/h4")).Select(iw => iw.Text));

            if (lockedCourseTitlesByDuration.Count > 0)
            {
                for (int i = 0; i < courseTitlesByDuration.Count; i++)
                {
                    for (int j = 0; j < lockedCourseTitlesByDuration.Count; j++)
                    {
                        if (courseTitlesByDuration[i] == lockedCourseTitlesByDuration[j])
                        {
                            courseTitlesByDuration.Remove(courseTitlesByDuration[i]);
                        }
                    }
                }
            }

            List <string> completedCourseTitlesByDuration = new List <string>(Browser.FindElements(By.XPath(" //span[@class='completed-date ng-binding']/../..//div[@class='activity-info-name']/h4")).Select(iw => iw.Text));

            if (completedCourseTitlesByDuration.Count > 0)
            {
                for (int i = 0; i < courseTitlesByDuration.Count; i++)
                {
                    for (int j = 0; j < completedCourseTitlesByDuration.Count; j++)
                    {
                        if (courseTitlesByDuration[i] == completedCourseTitlesByDuration[j])
                        {
                            courseTitlesByDuration.Remove(courseTitlesByDuration[i]);
                        }
                    }
                }
            }

            string firstCourseTitleByDuration = courseTitlesByDuration[0];

            ElemSet.ScrollToElement(Browser, Gcep.ResidentCourseTrackerLbl);
            CTP = Gcep.ClickToAdvance(Gcep.ResidentCouseStartNowBtn);

            string startedCourseTitleByDuration = CTP.CourseTitleLbl.Text;

            Assert.AreEqual(firstCourseTitleByDuration, startedCourseTitleByDuration);

            Browser.Navigate().Back();
            Gcep.WaitForInitialize();

            Gcep.ResidentGCEPSortBYProgressBtn.Click();
            Gcep.WaitForInitialize();

            if (Gcep.ResidentCouseStartNowBtn.GetAttribute("class").Contains("disabled"))
            {
                Gcep.ScrolltoGetAllCourses();
                Gcep.ResidentGcepShowElectiveCourseLnk.Click();
            }

            Gcep.ScrolltoGetAllCourses();

            List <string> courseTitlesProgress = new List <string>(Browser.FindElements(By.XPath("//div[@class='row activity-listing-row']//h4")).Select(iw => iw.Text));

            List <string> lockedCourseTitlesByProgress = new List <string>(Browser.FindElements(By.XPath(" //span[@class='locked']/../..//div[@class='activity-info-name']/h4")).Select(iw => iw.Text));

            if (lockedCourseTitlesByProgress.Count > 0)
            {
                for (int i = 0; i < courseTitlesProgress.Count; i++)
                {
                    for (int j = 0; j < lockedCourseTitlesByProgress.Count; j++)
                    {
                        if (courseTitlesProgress[i] == lockedCourseTitlesByProgress[j])
                        {
                            courseTitlesProgress.Remove(courseTitlesProgress[i]);
                        }
                    }
                }
            }

            List <string> completedCourseTitlesByProgress = new List <string>(Browser.FindElements(By.XPath(" //span[@class='completed-date ng-binding']/../..//div[@class='activity-info-name']/h4")).Select(iw => iw.Text));

            if (completedCourseTitlesByProgress.Count > 0)
            {
                for (int i = 0; i < courseTitlesProgress.Count; i++)
                {
                    for (int j = 0; j < completedCourseTitlesByProgress.Count; j++)
                    {
                        if (courseTitlesProgress[i] == completedCourseTitlesByProgress[j])
                        {
                            courseTitlesProgress.Remove(courseTitlesProgress[i]);
                        }
                    }
                }
            }

            string firstCourseTitleByProgress = courseTitlesProgress[0];

            ElemSet.ScrollToElement(Browser, Gcep.ResidentCourseTrackerLbl);
            CTP = Gcep.ClickToAdvance(Gcep.ResidentCouseStartNowBtn);

            string startedCourseTitleByProgress = CTP.CourseTitleLbl.Text;

            Assert.AreEqual(firstCourseTitleByProgress, startedCourseTitleByProgress);

            Browser.Navigate().Back();
            Gcep.WaitForInitialize();
        }
예제 #27
0
        public void Resident_CompletedCourse_Listing_AcedemicYear()
        {
            int countOfMatchingCoursesFor2018_2019 = 0;
            int countOfMatchingCoursesFor2017_2018 = 0;
            int countOfMatchingCoursesFor2016_2017 = 0;

            ///  1.Navigate to the login page login as
            LoginPage           LP = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED = LP.LoginAsUser("10031194", "password");//30248

            ///  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 getting count of courses if there is not any course assigned assign courses
            Gcep.ResidentGCEPCompletedSwitchBtn.Click();

            Browser.WaitForElement(Bys.GCEPPage.ResidentGCEPAcedimicYearSelElem, TimeSpan.FromSeconds(90), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);

            if (!Gcep.ResidentGCEPTranscriptBtn.GetAttribute("class").Contains("disabled"))
            {
                ///  4.Verifying transcript and certificate buttons are displayed and due date,progress and duration buttons are disabled..
                Assert.IsTrue(Gcep.ResidentGCEPTranscriptBtn.Displayed);
                Assert.IsTrue(Gcep.ResidentGCEPCertificatesDownloadBtn.Displayed);
                Assert.AreEqual("disabled", Gcep.ResidentGCEPSortBYDueDateBtn.GetAttribute("class"));
                Assert.AreEqual("disabled", Gcep.ResidentGCEPSortBYDurationBtn.GetAttribute("class"));
                Assert.AreEqual("disabled", Gcep.ResidentGCEPSortBYProgressBtn.GetAttribute("class"));

                ///  5. Scrolling down to get all information about completed courses.
                Gcep.ScrolltoGetAllCourses();

                ///  6.
                List <string> courseCompletionYears = new List <string>();
                List <string> CompletionDateTextRaw = new List <string>(Browser.FindElements(By.XPath("//div[@class='col-xs-12 col-md-2 activity-status-action']/button/../span[@class='completed-date ng-binding']")).Select(iw => iw.Text));
                for (int i = 0; i < CompletionDateTextRaw.Count; i++)
                {
                    courseCompletionYears.Add(CompletionDateTextRaw[i].Remove(0, 11));
                }


                List <string> selectValueAcedemicYearDropdown        = new List <string>(Browser.FindElements(Bys.GCEPPage.ResidentGCEPAcedimicYearSelElem).Select(IWebElement => IWebElement.Text));
                string        selectValueAcedemicYearDropdownTextRaw = selectValueAcedemicYearDropdown[0].ToString();
                string[]      selectedAcademicYear = null;
                if (BrowserName == BrowserNames.InternetExplorer)
                {
                    selectedAcademicYear = new string[] { "2018-2019", "2017-2018", "2016-2017" };
                }
                else
                {
                    string[] separatingChars = { "All Academic Years\r\n", " ", "\r\n" };
                    selectedAcademicYear = selectValueAcedemicYearDropdownTextRaw.Split(separatingChars, System.StringSplitOptions.RemoveEmptyEntries);
                }
                if ("2018-2019" == selectedAcademicYear[0])
                {
                    for (int k = 0; k < courseCompletionYears.Count; k++)
                    {
                        if (Convert.ToDateTime("07 / 01 / 2018") <= Convert.ToDateTime(courseCompletionYears[k]) & Convert.ToDateTime(courseCompletionYears[k]) <= Convert.ToDateTime("06 / 30 / 2019"))
                        {
                            countOfMatchingCoursesFor2018_2019++;
                        }
                    }
                }
                if ("2017-2018" == selectedAcademicYear[1])
                {
                    for (int l = 0; l < courseCompletionYears.Count; l++)
                    {
                        if (Convert.ToDateTime("07 / 01 / 2017") <= Convert.ToDateTime(courseCompletionYears[l]) & Convert.ToDateTime(courseCompletionYears[l]) <= Convert.ToDateTime("06 / 30 / 2018"))
                        {
                            countOfMatchingCoursesFor2017_2018++;
                        }
                    }
                }
                if ("2016-2017" == selectedAcademicYear[2])
                {
                    for (int n = 0; n < courseCompletionYears.Count; n++)
                    {
                        if (Convert.ToDateTime("07 / 01 / 2016") <= Convert.ToDateTime(courseCompletionYears[n]) & Convert.ToDateTime(courseCompletionYears[n]) <= Convert.ToDateTime("06 / 30 / 2017"))
                        {
                            countOfMatchingCoursesFor2016_2017++;
                        }
                    }
                }

                Gcep.ResidentGCEPAcedimicYearSelElem.SelectByIndex(1);
                Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                ElemSet.ScrollToElement(Browser, Gcep.FaceBookLnk);

                if (countOfMatchingCoursesFor2018_2019 == 0)
                {
                    Assert.True(Gcep.ResidentNoCourseBeenCompltetLbl.Displayed);
                }
                else
                {
                    IList <IWebElement> CourseRows = Browser.FindElements(By.XPath("//div[@class='activity-listing-bottom ng-scope']"));
                    int countOfCoursesFirstIndex   = CourseRows.Count;
                    Assert.True(countOfMatchingCoursesFor2018_2019 == countOfCoursesFirstIndex);
                }


                Gcep.ResidentGCEPAcedimicYearSelElem.SelectByIndex(2);
                Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                Gcep.ScrolltoGetAllCourses();


                if (countOfMatchingCoursesFor2017_2018 == 0)
                {
                    Assert.True(Gcep.ResidentNoCourseBeenCompltetLbl.Displayed);
                }
                else
                {
                    IList <IWebElement> CourseRows = Browser.FindElements(By.XPath("//div[@class='activity-listing-bottom ng-scope']"));
                    int countOfCoursesSecondIndex  = CourseRows.Count;
                    Assert.True(countOfMatchingCoursesFor2017_2018 == countOfCoursesSecondIndex);
                }

                Gcep.ResidentGCEPAcedimicYearSelElem.SelectByIndex(3);
                Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                Gcep.ScrolltoGetAllCourses();

                if (countOfMatchingCoursesFor2016_2017 == 0)
                {
                    Assert.True(Gcep.ResidentNoCourseBeenCompltetLbl.Displayed);
                }
                else
                {
                    IList <IWebElement> CourseRows = Browser.FindElements(By.XPath("//div[@class='activity-listing-bottom ng-scope']"));
                    int countOfCoursesThirdIndex   = CourseRows.Count;
                    Assert.True(countOfMatchingCoursesFor2016_2017 == countOfCoursesThirdIndex);
                }
            }
        }
예제 #28
0
        public void Manage_MultyProgram_CurriculumAssignmentFlow()
        {
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Manager);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            ///  2.click to CGEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  3.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));
            string ProgramName           = GCEP.ReturnValueAfterSelectingProgram(1);// GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 1);
            int    firstProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            ///  4.Clicking Curruculum template link and getting breadcrump text and verifying with program name
            CurriculumMngPage CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            //  var value = Browser.FindElement(Bys.AMAPage.BreadCrump).Text;
            string expectedFromCM = CM.GetBreadCrumbContainerText();

            Assert.IsTrue(expectedFromCM.Contains(ProgramName.ToLower()));
            string breadCrumpAfterAssigment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111");

            Assert.True(breadCrumpAfterAssigment.Contains(ProgramName.ToLower()));

            Thread.Sleep(2000);

            ///  5.Clicking to the the breadcrump with Program name and naviagting GCEP page
            GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(ProgramName);

            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  6.Choosing second Program from  Dropdown and saving Program name and count of users for program
            string secondProgramName      = GCEP.ReturnValueAfterSelectingProgram(2); //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 2);
            int    secondProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            ///  7.Clicking Curruculum template link and getting breadcrump text for second Porgram and verifying with Program name
            CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            string secondexpectedFromCM = CM.GetBreadCrumbContainerText();

            Assert.IsTrue(secondexpectedFromCM.Contains(secondProgramName.ToLower()));
            string secondBreadcrumpAfterAssignment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111");

            Assert.True(secondBreadcrumpAfterAssignment.Contains(secondProgramName.ToLower()));

            Thread.Sleep(2000);

            ///  8.Cliking to the the breadcrump with  second Program name and naviagting GCEP page  and getting breadcrump text for third Porgram
            GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(secondProgramName);
            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);
            string thirdProgramName      = GCEP.ReturnValueAfterSelectingProgram(3); //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 3);
            int    thirdProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            Thread.Sleep(2000);
            ///  9.Clicking Curruculum template link and verifying with third Program name
            CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            string thirdexpectedFromCM = CM.GetBreadCrumbContainerText();

            Assert.IsTrue(thirdexpectedFromCM.Contains(thirdProgramName.ToLower()));
            string thirdBreadcrumpAfterAssignment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111");

            Assert.True(thirdBreadcrumpAfterAssignment.Contains(thirdProgramName.ToLower()));

            Thread.Sleep(2000);

            GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(thirdProgramName);
            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  10.Verifying each program has different count of users.
            Assert.False(DataUtils.intsEqual(firstProgramUserCount, secondProgramUserCount, thirdProgramUserCount));
        }
예제 #29
0
        public void Resident_Pass_Test(string InstitutionName, string CurriculumName)
        {
            UserInfo            role = UserUtils.GetUser(UserRole.Ama_Staff);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            ///  2.click to GCEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage 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(InstitutionName);

            ProgramsPage Program = InsGcep.ClickToAdvance(InsGcep.InstitutionProgramManagmentLnk);

            Program.UnassignCurriculum();

            CurriculumMngPage Curriculum = InsGcep.ClickToAdvance(InsGcep.InstitutionCurriculumTmpLnk);

            Curriculum.Search(CurriculumName);
            Curriculum.DeleteCurriculum(CurriculumName);
            CurriculumCoursePage CurCoursPage = Curriculum.ClickToAdvance(Curriculum.CreateCurriculumTemplateBtn);

            ///  4.Form course page choosing available courses from table by index
            CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 1, 4, 5);

            // 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(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, 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(CurriculumName);
            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), CurriculumName);

            ///  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("10021387", "password");//10021375,10021377,21387
            Gcep = ED.ClickToAdvance(ED.GcepLnk);
            Assert.True(Gcep.VerificationOfChoosenCoursesAssignedForResident(browser, CourseNames), "Course count are not equal");
            CourseTestPage Course = Gcep.ResidentStartCourseOrContinue(browser, CourseNames[1]);

            Gcep = Course.TestPass();
            Assert.IsTrue(Gcep.VerificationCourseCompletion(browser, CourseNames[1], "View Certificate"), "View Certificet button not visible");
        }
예제 #30
0
        public void MultyProgram_CreatingCurriculum_Flow()
        {
            string curriculumName = "";

            if (BrowserName == BrowserNames.Chrome)
            {
                curriculumName = "Chrome3CurrName";
            }
            if (BrowserName == BrowserNames.Firefox)
            {
                curriculumName = "FireFox3CurrName";
            }
            if (BrowserName == BrowserNames.InternetExplorer)
            {
                curriculumName = "IE3CurrName";
            }
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Manager);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            ///  2.click to CGEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            /// 3.Verifiying breadcrump is the same as a Program name saving Program name
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));
            string ProgramName = GCEP.ReturnValueAfterSelectingProgram(1);   // GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 1);

            ///  4.Clicking Curruculum template link creating curriculum searching for curriculum if its not exist then creating curriculum with name depending on browser name
            CurriculumMngPage CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);

            CurTemp.Search(curriculumName);
            if (Browser.FindElements(Bys.CurriculumMngPage.NoRecordLbl).Count > 0)
            {
                CurriculumCoursePage CurCoursPage = CurTemp.ClickToAdvance(CurTemp.CreateCurriculumTemplateBtn);
                HelperMethods.CurriculumCreationFlow(browser, curriculumName);
            }

            ///  5.Cliking to the the breadcrump with Program name and naviagting GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(ProgramName);
            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  6.Choosing second Program from  Dropdown and saving Institution name
            string secondProgramName = GCEP.ReturnValueAfterSelectingProgram(2);  //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 2);

            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));
            Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled); //delete after performance issue removed

            ///  7.Clicking Curruculum template link searching for curriculum what we create for first Program
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  8. Verifiying curriculum not displayed for different Program
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  9.Clicking breadcrump with second Program name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(secondProgramName);

            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  10.Verifiying breadcrump is the same as a Program name saving Program name for third Program
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));
            string thirdProgramName = GCEP.ReturnValueAfterSelectingProgram(3);                     //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 3);

            Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled); //delete after performance issue removed

            ///  11.Clicking Curruculum template link searching for curriculum what we create for first Program
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  12. Verifiying curriculum not displayed for different Program
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  13.Clicking breadcrump with third Program name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(thirdProgramName);
            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  14. Choosing first Program from dropdown waiting for initialize page
            GCEP.ProgramSelElem.SelectByText(ProgramName);
            GCEP.WaitForInitialize();
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));

            Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled);  //delete after performance issue removed

            ///  15.Clicking Curruculum template link searching for curriculum what we create for first Program
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  16.Deleting curriculum and verifying label is displayed
            CurTemp.DeleteCurriculum(curriculumName);
            Assert.IsTrue(CurTemp.NoRecordLabel.Displayed);
        }