Example #1
0
        // This test cant be run in parallel across browsers because agendas in the Meeting Agenda dropdown may get mixed up between parallel runs.
        // See RCPSC-547 for the status of a redesign that would fix that
        public void LearnerStageLabelReflectsPromotion()
        {
            // Only running this test in Chrome because it is a long test and we can not run it in parallel. Whenever JIRA task
            // https://code.premierinc.com/issues/browse/RCPSC-547 is complete, we can run this test in parallel because
            // the UI will be redesigned so that the agendas will not get mixed up during parallel runs
            if (BrowserName == BrowserNames.Chrome)
            {
                /// 1. Login as a program admin
                LoginPage        LP = Navigation.GoToLoginPage(browser);
                CBDProgAdminPage PP = LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, ConfigurationManager.AppSettings["LoginPassword"]);

                /// 2. Create an upcoming agenda, then choose this agenda in the Meeting Agenda dropdown
                /// 4. Click on the Set Status button and then set the status of the learner to stage 2
                /// 5. Finalize the Agenda
                PP.CreateChangeAndFinalizeAgendaForLearner(learner1FullNamePerBrowser, "Reviewed", "High", "_TA_AStatic User_CC_001", "Progressing as Expected",
                                                           "Promote Learner - to Stage 3");

                /// 6. Log out then log back in as the learner
                PP.ClickAndWaitBasePage(PP.LogoutLnk);
                Navigation.GoToLoginPage(browser);
                CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, learner1LoginPerBrowser, ConfigurationManager.AppSettings["LoginPassword"]);

                /// 7. Assert that the text to the right of the Program label reflects the change to stage 2
                Assert.True(CLP.CurrentStageValueLbl.Text.Contains("Core of Discipline"));

                // Cleanup data by setting the learner back to stage 2
                PP.ClickAndWaitBasePage(PP.LogoutLnk);
                Navigation.GoToLoginPage(browser);
                LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, ConfigurationManager.AppSettings["LoginPassword"]);
                PP.CreateChangeAndFinalizeAgendaForLearner(learner1FullNamePerBrowser, null, null, null, "Progressing as Expected",
                                                           "Promote Learner - to Stage 2");
            }
        }
        // This cant be run in parallel across browsers because agendas in the Meeting Agenda dropdown may get mixed up between parallel runs. See RCPSC-547
        // for the status of a redesign that would fix that
        //[NonParallelizable]
        public void LearnerStageLabelReflectsPromotion()
        {
            /// 1. Login as a program admin
            LoginPage        LP = Navigation.GoToLoginPage(browser);
            CBDProgAdminPage PP = LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, "test");

            /// 2. Create an upcoming agenda, then choose this agenda in the Meeting Agenda dropdown
            /// 4. Click on the Set Status button and then set the status of the learner to stage 2
            /// 5. Finalize the Agenda
            PP.CreateChangeAndFinalizeAgendaForLearner(learnerFullNamePerBrowser, "Reviewed", "High", "_TA_AStatic User_CC_001", "Progressing as Expected",
                                                       "Promote Learner - to Stage 3");

            /// 6. Log out then log back in as the learner
            PP.ClickAndWait(PP.LogoutLnk);
            Navigation.GoToLoginPage(browser);
            CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, learnerLoginPerBrowser, "test");

            /// 7. Assert that the text to the right of the Program label reflects the change to stage 2
            Assert.True(CLP.CurrentStageValueLbl.Text.Contains("Core of Discipline"));

            // Cleanup data by setting the learner back to stage 2
            PP.ClickAndWait(PP.LogoutLnk);
            Navigation.GoToLoginPage(browser);
            LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, "test");
            PP.CreateChangeAndFinalizeAgendaForLearner(learnerFullNamePerBrowser, null, null, null, "Progressing as Expected",
                                                       "Promote Learner - to Stage 2");
        }
        public void ProgAdminCanAddSupportingDocuments()
        {
            /// 1. Login
            LoginPage        LP = Navigation.GoToLoginPage(browser);
            CBDProgAdminPage PA = LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, "test");

            PA.AddSupportDocumentation(UserUtils.Learner1FullName, "C:\\Myfolder");
        }
        public void ProgAdminCanAddSupportingDocuments()
        {
            /// 1. Login
            LoginPage        LP = Navigation.GoToLoginPage(browser);
            CBDProgAdminPage PA = LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, ConfigurationManager.AppSettings["LoginPassword"]);

            PA.AddSupportDocumentation(UserUtils.Learner1FullName, "C:\\Myfolder");
        }
        public void ProgAdminCanSchedProgMeet()
        {
            /// 1. Login as a program admin
            LoginPage        LP = Navigation.GoToLoginPage(browser);
            CBDProgAdminPage PA = LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, "test");

            /// 2. Choose a learner in the learners table, click on the Actions button, click on Schedule Progress Meeting, fill in
            /// all of the fields and click Submit
            PA.ScheduleProgressMeeting(UserUtils.Learner1FullName);
        }
        public void ProgAdminCanAddNotes()
        {
            /// 1. Login as a program admin
            LoginPage        LP = Navigation.GoToLoginPage(browser);
            CBDProgAdminPage PA = LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, "test");

            /// 2. Choose a learner in the learners table, click on the Actions button, click on Add Notes, add some notes
            /// and click Submit
            PA.AddNotes(UserUtils.Learner1FullName, "C:\\Myfolder");
        }
        public void ProgAdminCanAddAndRemoveFlag()
        {
            /// 1. Login as a program admin
            LoginPage        LP = Navigation.GoToLoginPage(browser);
            CBDProgAdminPage PA = LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, "test");

            /// 2. Choose a learner in the learners table, click on the Actions button, click on Add/Remove Flag,
            /// fill in all of the fields and click Save Flag
            PA.AddFlag(UserUtils.Learner1FullName);

            /// 3. Choose a learner in the learners table, click on the Actions button, click on Add/Remove Flag,
            /// fill in all of the fields and click Remove Flag
            PA.RemoveFlag(UserUtils.Learner1FullName);
        }
        public void ProgAdminCanAssignMSFObservation()
        {
            /// 1. Login as a program admin
            LoginPage        LP  = Navigation.GoToLoginPage(browser);
            CBDProgAdminPage PAP = LP.LoginAsExistingUser(UserUtils.UserRole.PA, UserUtils.ProgAdmin1Login, "test");

            /// 2. Choose a learner, open the Assign Observation form, fill it out, choose 2 observers, then click Assign
            PAP.AssignObservation(UserUtils.Learner1FullName,
                                  "Multiple Source Feedback",
                                  "2 - Foundations of Discipline",
                                  "2.20 Managing common complications of labour analgesia",
                                  "Part B: Multisource feedback - Form 3",
                                  UserUtils.Observer1FullName,
                                  UserUtils.Observer2FullName);
        }
Example #9
0
        /// <summary>
        /// Enters text in the username and password field, clicks the login button, then waits for the URL
        /// of the Dashboard page to load
        /// </summary>
        /// <param name="role">Either "learner", "observer", "program admin", etc.</param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        public dynamic LoginAsExistingUser(UserUtils.UserRole role, string userName, string password)
        {
            // Login with a valid user
            UserNameTxt.Clear();
            PasswordTxt.Clear();
            UserNameTxt.SendKeys(userName);
            PasswordTxt.SendKeys(password);
            PasswordTxt.SendKeys(Keys.Tab);
            ClickAndWait(LoginBtn);

            switch (role)
            {
            case UserUtils.UserRole.LR:
                CBDLearnerPage LP = new CBDLearnerPage(Browser);
                LP.WaitForInitialize();

                // Adding these if statements here because sometimes the graph doesnt appear after we login. It only happens about 5 percent of the time,
                // so DEV is not looking into it. So if the graph does not appear, then we will navigate to the already loaded page again
                // UPDATE: Added another if statement to refresh again. This was working perfectly before today (Today I increased the amount of parallel
                // tests, and also started running Firefox again, so the issue is either with Firefox, or with increasing the max parallel setting. The max
                // is set at 16 now, this never was an issue when max was set to 6)
                if (Browser.FindElements(By.Id("EPAChart")).Count == 0)
                {
                    Browser.WaitForElement(Bys.RCPPage.CBDTab, ElementCriteria.IsVisible);
                    ClickAndWaitBasePage(CBDTab);
                    try
                    {
                        LP.WaitUntil(TimeSpan.FromSeconds(60), Criteria.CBDLearnerPage.EPAChartVisibleAndEnabledAndHasText);
                    }
                    catch
                    {
                        if (Browser.FindElements(By.Id("EPAChart")).Count == 0)
                        {
                            Browser.WaitForElement(Bys.RCPPage.CBDTab, ElementCriteria.IsVisible);
                            ClickAndWaitBasePage(CBDTab);
                            LP.WaitUntil(TimeSpan.FromSeconds(60), Criteria.CBDLearnerPage.EPAChartVisibleAndEnabledAndHasText);
                        }
                    }
                }
                return(LP);

            case UserUtils.UserRole.OB:
                CBDObserverPage OP = new CBDObserverPage(Browser);
                OP.WaitForInitialize();
                return(OP);

            case UserUtils.UserRole.PA:
                CBDProgAdminPage PA = new CBDProgAdminPage(Browser);
                PA.WaitForInitialize();
                return(PA);

            case UserUtils.UserRole.PD:
                CBDProgDirectorPage PD = new CBDProgDirectorPage(Browser);
                PD.WaitForInitialize();
                return(PD);

            case UserUtils.UserRole.PGD:
                CBDProgDeanPage page = new CBDProgDeanPage(Browser);
                page.WaitForInitialize();
                return(page);

            case UserUtils.UserRole.CUPER:
                MyDashboardPage PERCUMyDashboardPage = new MyDashboardPage(Browser);
                PERCUMyDashboardPage.WaitForInitialize();
                PERCredentialStaffPage CP = PERCUMyDashboardPage.ClickAndWaitBasePage(PERCUMyDashboardPage.PERAFCTab);
                return(CP);

            case UserUtils.UserRole.CSDiploma:
                DiplomaClinicalSupervisorPage CSP = new DiplomaClinicalSupervisorPage(Browser);
                CSP.WaitForInitialize();
                return(CSP);

            case UserUtils.UserRole.CUDiploma:
                MyDashboardPage DiplomaCUMyDashboardPage = new MyDashboardPage(Browser);
                DiplomaCUMyDashboardPage.WaitForInitialize();
                DiplomaCredentialStaffPage DCUP = DiplomaCUMyDashboardPage.ClickAndWaitBasePage(DiplomaCUMyDashboardPage.MyDiplomaTab);
                return(DCUP);

            case UserUtils.UserRole.DDDiploma:
                DiplomaDirectorPage DD = new DiplomaDirectorPage(Browser);
                DD.WaitForInitialize();
                return(DD);

            case UserUtils.UserRole.FOMDiploma:
                DiplomaFacOfMedicinePage FOMP = new DiplomaFacOfMedicinePage(Browser);
                FOMP.WaitForInitialize();
                return(FOMP);

            case UserUtils.UserRole.MP:
                MyDashboardPage DP = new MyDashboardPage(Browser);
                DP.WaitForInitialize();
                return(DP);

            case UserUtils.UserRole.TraineePER:
                PERTraineePage PTP = new PERTraineePage(Browser);
                PTP.WaitForInitialize();
                return(PTP);

            case UserUtils.UserRole.TraineeDiploma:
                DiplomaTraineePage DTP = new DiplomaTraineePage(Browser);
                DTP.WaitForInitialize();
                return(DTP);

            case UserUtils.UserRole.REF:
                PERRefereePage PERRP = new PERRefereePage(Browser);
                PERRP.WaitForInitialize();
                return(PERRP);

            case UserUtils.UserRole.ASRPER:
                PERAssessorPage AP = new PERAssessorPage(Browser);
                AP.WaitForInitialize();
                return(AP);

            case UserUtils.UserRole.ASRDiploma:
                DiplomaAssessorPage DAP = new DiplomaAssessorPage(Browser);
                DAP.WaitForInitialize();
                return(DAP);
            }

            return(null);
        }
Example #10
0
        /// <summary>
        /// Logs out of the current user only if a user is currently logged in, enters text in the username and password field,
        /// clicks the login button, then waits for the URL of the Dashboard page to load
        /// </summary>
        /// <param name="role">Either "learner", "observer", "program admin", etc.</param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="newUser">true or false, depending on if it is a new user or not</param>
        public dynamic LoginAsNewUser(UserUtils.UserRole role, string userName, string password)
        {
            IWebElement acceptBtn = null;

            // Login with a valid user
            UserNameTxt.Clear();
            PasswordTxt.Clear();
            UserNameTxt.SendKeys(userName);
            PasswordTxt.SendKeys(password);
            PasswordTxt.SendKeys(Keys.Tab);
            ClickAndWait(LoginBtn);

            // For some reason, the Selenium click fails to make the RCP page login, it instead stays at the login page.
            // This happens maybe 5% of the time. So we will add a try catch block here to click the login button
            // again if it fails
            try
            {
                acceptBtn = Browser.WaitForElement(Bys.LoginPage.iAcceptBtn, TimeSpan.FromSeconds(10), ElementCriteria.IsVisible);
            }
            catch
            {
                ClickAndWait(LoginBtn);
                acceptBtn = Browser.WaitForElement(Bys.LoginPage.iAcceptBtn, ElementCriteria.IsVisible);
            }

            Thread.Sleep(0300);
            acceptBtn.Click();

            // Depending on the role of the user that we use, we need to wait differently and return different pages
            switch (role)
            {
            case UserUtils.UserRole.LR:
                CBDLearnerPage LP = new CBDLearnerPage(Browser);
                LP.WaitForInitialize();

                // Adding these if statements here because sometimes the graph doesnt appear after we login. It only happens about 5 percent of the time,
                // so DEV is not looking into it. So if the graph does not appear, then we will navigate to the already loaded page again
                // UPDATE: Added another if statement to refresh again. This was working perfectly before today (Today I increased the amount of parallel
                // tests, and also started running Firefox again, so the issue is either with Firefox, or with increasing the max parallel setting. The max
                // is set at 16 now, this never was an issue when max was set to 6)
                // UPDATE: Two if statements still didndt resolve the issue. Going to remove Navigation method, and instead click  on the CBD tab and see
                // if that works
                if (Browser.FindElements(By.Id("EPAChart")).Count == 0)
                {
                    Browser.WaitForElement(Bys.RCPPage.CBDTab, ElementCriteria.IsVisible);
                    ClickAndWaitBasePage(CBDTab);
                    try
                    {
                        LP.WaitUntil(TimeSpan.FromSeconds(60), Criteria.CBDLearnerPage.EPAChartVisibleAndEnabledAndHasText);
                    }
                    catch
                    {
                        if (Browser.FindElements(By.Id("EPAChart")).Count == 0)
                        {
                            Browser.WaitForElement(Bys.RCPPage.CBDTab, ElementCriteria.IsVisible);
                            ClickAndWaitBasePage(CBDTab);
                            LP.WaitUntil(TimeSpan.FromSeconds(60), Criteria.CBDLearnerPage.EPAChartVisibleAndEnabledAndHasText);
                        }
                    }
                }

                return(LP);

            case UserUtils.UserRole.OB:
                CBDObserverPage OP = new CBDObserverPage(Browser);
                OP.WaitForInitialize();
                return(OP);

            case UserUtils.UserRole.PA:
                CBDProgAdminPage PA = new CBDProgAdminPage(Browser);
                PA.WaitForInitialize();
                return(PA);

            case UserUtils.UserRole.TraineePER:
                PERTraineePage PTP = new PERTraineePage(Browser);
                PTP.WaitForInitialize();
                return(PTP);

            case UserUtils.UserRole.TraineeDiploma:
                DiplomaTraineePage DTP = new DiplomaTraineePage(Browser);
                DTP.WaitForInitialize();
                return(DTP);

            case UserUtils.UserRole.MP:
                MyDashboardPage DP = new MyDashboardPage(Browser);
                DP.WaitForInitialize();
                return(DP);
            }

            return(null);
        }
Example #11
0
        /// <summary>
        /// Enters text in the username and password field, clicks the login button, then waits for the URL
        /// of the Dashboard page to load
        /// </summary>
        /// <param name="role">Either "learner", "observer", "program admin", etc.</param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        public dynamic LoginAsExistingUser(UserUtils.UserRole role, string userName, string password)
        {
            // Login with a valid user
            UserNameTxt.Clear();
            PasswordTxt.Clear();
            UserNameTxt.SendKeys(userName);
            PasswordTxt.SendKeys(password);
            PasswordTxt.SendKeys(Keys.Tab);
            ClickAndWait(LoginBtn);

            switch (role)
            {
            case UserUtils.UserRole.LR:
                CBDLearnerPage LP = new CBDLearnerPage(Browser);
                LP.WaitForInitialize();

                // Adding this if statements here because sometimes the graph doesnt appear after we login. It only happens about 5 percent of the time,
                // so DEV is not looking into it. So if the graph does not appear, then we will navigate to the already loaded page again
                if (Browser.FindElements(By.Id("EPAChart")).Count == 0)
                {
                    Navigation.GoToLearnerPage(Browser);
                    LP.WaitUntil(TimeSpan.FromSeconds(30), Criteria.CBDLearnerPage.EPAChartVisibleAndEnabledAndHasText);
                }
                return(LP);

            case UserUtils.UserRole.OB:
                CBDObserverPage OP = new CBDObserverPage(Browser);
                OP.WaitForInitialize();
                return(OP);

            case UserUtils.UserRole.PA:
                CBDProgAdminPage PA = new CBDProgAdminPage(Browser);
                PA.WaitForInitialize();
                return(PA);

            case UserUtils.UserRole.PD:
                CBDProgDirectorPage PD = new CBDProgDirectorPage(Browser);
                PD.WaitForInitialize();
                return(PD);

            case UserUtils.UserRole.PGD:
                CBDProgDeanPage page = new CBDProgDeanPage(Browser);
                page.WaitForInitialize();
                return(page);

            case UserUtils.UserRole.CUPER:
                MyDashboardPage PERCUMyDashboardPage = new MyDashboardPage(Browser);
                PERCUMyDashboardPage.WaitForInitialize();
                PERCredentialStaffPage CP = PERCUMyDashboardPage.ClickAndWaitBasePage(PERCUMyDashboardPage.PERAFCTab);
                return(CP);

            case UserUtils.UserRole.CSDiploma:
                DiplomaClinicalSupervisorPage CSP = new DiplomaClinicalSupervisorPage(Browser);
                CSP.WaitForInitialize();
                return(CSP);

            case UserUtils.UserRole.CUDiploma:
                MyDashboardPage DiplomaCUMyDashboardPage = new MyDashboardPage(Browser);
                DiplomaCUMyDashboardPage.WaitForInitialize();
                DiplomaCredentialStaffPage DCUP = DiplomaCUMyDashboardPage.ClickAndWaitBasePage(DiplomaCUMyDashboardPage.MyDiplomaTab);
                return(DCUP);

            case UserUtils.UserRole.DDDiploma:
                DiplomaDirectorPage DD = new DiplomaDirectorPage(Browser);
                DD.WaitForInitialize();
                return(DD);

            case UserUtils.UserRole.FOMDiploma:
                DiplomaFacOfMedicinePage FOMP = new DiplomaFacOfMedicinePage(Browser);
                FOMP.WaitForInitialize();
                return(FOMP);

            case UserUtils.UserRole.MP:
                MyDashboardPage DP = new MyDashboardPage(Browser);
                DP.WaitForInitialize();
                return(DP);

            case UserUtils.UserRole.TraineePER:
                PERTraineePage PTP = new PERTraineePage(Browser);
                PTP.WaitForInitialize();
                return(PTP);

            case UserUtils.UserRole.TraineeDiploma:
                DiplomaTraineePage DTP = new DiplomaTraineePage(Browser);
                DTP.WaitForInitialize();
                return(DTP);

            case UserUtils.UserRole.REF:
                PERRefereePage PERRP = new PERRefereePage(Browser);
                PERRP.WaitForInitialize();
                return(PERRP);

            case UserUtils.UserRole.ASRPER:
                PERAssessorPage AP = new PERAssessorPage(Browser);
                AP.WaitForInitialize();
                return(AP);

            case UserUtils.UserRole.ASRDiploma:
                DiplomaAssessorPage DAP = new DiplomaAssessorPage(Browser);
                DAP.WaitForInitialize();
                return(DAP);
            }

            return(null);
        }
Example #12
0
        /// <summary>
        /// Logs out of the current user only if a user is currently logged in, enters text in the username and password field,
        /// clicks the login button, then waits for the URL of the Dashboard page to load
        /// </summary>
        /// <param name="role">Either "learner", "observer", "program admin", etc.</param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="newUser">true or false, depending on if it is a new user or not</param>
        public dynamic LoginAsNewUser(UserUtils.UserRole role, string userName, string password)
        {
            IWebElement acceptBtn = null;

            // Login with a valid user
            UserNameTxt.Clear();
            PasswordTxt.Clear();
            UserNameTxt.SendKeys(userName);
            PasswordTxt.SendKeys(password);
            PasswordTxt.SendKeys(Keys.Tab);
            ClickAndWait(LoginBtn);

            // For some reason, the Selenium click fails to make the RCP page login, it instead stays at the login page.
            // This happens maybe 5% of the time. So we will add a try catch block here to click the login button
            // again if it fails
            try
            {
                acceptBtn = Browser.WaitForElement(Bys.LoginPage.iAcceptBtn, TimeSpan.FromSeconds(10), ElementCriteria.IsVisible);
            }
            catch
            {
                ClickAndWait(LoginBtn);
                acceptBtn = Browser.WaitForElement(Bys.LoginPage.iAcceptBtn, ElementCriteria.IsVisible);
            }

            Thread.Sleep(0300);
            acceptBtn.Click();

            // Depending on the role of the user that we use, we need to wait differently and return different pages
            switch (role)
            {
            case UserUtils.UserRole.LR:
                CBDLearnerPage LP = new CBDLearnerPage(Browser);
                LP.WaitForInitialize();

                // Adding this if statements here because sometimes the graph doesnt appear after we login.
                // It only happens about 5 percent of the time, so DEV is not looking into it. So if the
                // graph does not appear, then we will navigate to the already loaded page again

                if (Browser.FindElements(By.Id("EPAChart")).Count == 0)
                {
                    Navigation.GoToLearnerPage(Browser);
                    LP.WaitUntil(TimeSpan.FromSeconds(30), Criteria.CBDLearnerPage.EPAChartVisibleAndEnabledAndHasText);
                }

                return(LP);

            case UserUtils.UserRole.OB:
                CBDObserverPage OP = new CBDObserverPage(Browser);
                OP.WaitForInitialize();
                return(OP);

            case UserUtils.UserRole.PA:
                CBDProgAdminPage PA = new CBDProgAdminPage(Browser);
                PA.WaitForInitialize();
                return(PA);

            case UserUtils.UserRole.TraineePER:
                PERTraineePage PTP = new PERTraineePage(Browser);
                PTP.WaitForInitialize();
                return(PTP);

            case UserUtils.UserRole.TraineeDiploma:
                DiplomaTraineePage DTP = new DiplomaTraineePage(Browser);
                DTP.WaitForInitialize();
                return(DTP);

            case UserUtils.UserRole.MP:
                MyDashboardPage DP = new MyDashboardPage(Browser);
                DP.WaitForInitialize();
                return(DP);
            }

            return(null);
        }