public void ReflectionShowsInTableAfterAdded() { // TEMPORARY: When the Delete User API is developed, we can remove the below code and uncomment the code below it, which creates new users // on the fly. Decide this when the delete API is complete /// 1. Login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, UserUtils.Learner1Login, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Add a reflection LearnerRelectionObject LR = CLP.AddReflection(); /// 3. Switch to the Reflection tab and verify the reflection is shown in the table CLP.SwitchToTab(CLP.ReflectionsTab, Bys.CBDLearnerPage.ReflectionsTab); Assert.True(ElemGet.Grid_ContainsRecord(browser, CLP.ReflectionsTbl, Bys.CBDLearnerPage.ReflectionsTblBdy, 0, LR.ReflectionTitle, "td", Bys.CBDLearnerPage.TableFirstBtn, Bys.CBDLearnerPage.TableNextBtn)); ///// 1. Login as learner //LoginPage LP = Navigation.GoToLoginPage(browser); //UserInfo LRUser = UserUtils.CreateAndRegisterUser(null, UserUtils.Application.CBD, UserUtils.UserRole.LR); //CBDLearnerPage CLP = LP.Login(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password, false); ///// 2. Add a reflection //LearnerRelectionObject LR = CLP.AddReflection(); ///// 3. Switch to the Reflection tab and verify the reflection is shown in the table //CLP.SwitchToTab(CLP.ReflectionsTab, Bys.CBDLearnerPage.ReflectionsTab); //Assert.True(ElemGet.Grid_ContainsRecord(browser, CLP.ReflectionsTbl, LR.ReflectionTitle, Bys.CBDLearnerPage.TableFirstBtn, Bys.CBDLearnerPage.TableNextBtn)); }
public void EPAAttnGraphUpdatesAfterObserverCompletesAssessment() { /// 1. Create learner and observer users and login as the learner LoginPage LP = Navigation.GoToLoginPage(browser); // We are using a try catch here for the following reason. This test is the very first test that gets run during the build. For some reason, the // RegisterUser API fails to complete and throws a 500 error whenever the first test gets set off on the grid. So if the error happens, then we will // just call the API again in the Catch block and proceed UserInfo LRUser = null; try { LRUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR); } catch { LRUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR); } UserInfo OBUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.OB); CBDLearnerPage CLP = LP.LoginAsNewUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); /// 2. Store the number of observations we will use throughout the test into a variable int noOfObs = 4; /// 3. Request 4 observations for EPA 1.1, with randomized ratings for each observation List <LearnerRequestObsObject> LRO = CLP.RequestObservationsForEPA(CLP.EPAIMTbl, Bys.CBDLearnerPage.EPAIMTbl, "Transition to Discipline", "Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", OBUser.FullName, "Part A: Direct observation - Form 1", noOfObs); /// 4. Log out and then log in as the observer that the learner requested CLP.ClickAndWaitBasePage(CLP.LogoutLnk); Navigation.GoToLoginPage(browser); CBDObserverPage OP = LP.LoginAsNewUser(UserUtils.UserRole.OB, OBUser.Username, OBUser.Password); /// 5. Accept the pending observation requests and complete the Assessment forms for all 4 of the observations List <CompletedAssessmentInfo> completedAssessments = OP.AcceptAndCompleteObservations(LRUser.FullName, "Part A: Direct observation - Form 1", noOfObs); /// 6. Calculate the min, max and mean values for the completed observations above decimal minExpected = OP.GetMinMaxOrMeanFromMultipleCompletedAssessments(completedAssessments, "min"); decimal maxExpected = OP.GetMinMaxOrMeanFromMultipleCompletedAssessments(completedAssessments, "max"); decimal meanExpected = OP.GetMinMaxOrMeanFromMultipleCompletedAssessments(completedAssessments, "mean"); /// 8. Log out and then log in as the learner CLP.ClickAndWaitBasePage(CLP.LogoutLnk); Navigation.GoToLoginPage(browser); LP.LoginAsExistingUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); /// 9. Open the Reports popup, obtain the actual values from the graph through JQuery, then assert them against the expected calculated values obtained above CLP.ClickAndWait(CLP.ViewMoreRptsLnk); decimal minActual = CLP.GetMinMeanOrMaxFromEPAAttainGraph(CLP.ReportsFormEPAAttainmentChrt, string.Format("EPA 1.1 ({0})", noOfObs), "min"); Assert.AreEqual(minExpected, minActual); decimal maxActual = CLP.GetMinMeanOrMaxFromEPAAttainGraph(CLP.ReportsFormEPAAttainmentChrt, string.Format("EPA 1.1 ({0})", noOfObs), "max"); Assert.AreEqual(maxExpected, maxActual); decimal meanActual = CLP.GetMinMeanOrMaxFromEPAAttainGraph(CLP.ReportsFormEPAAttainmentChrt, string.Format("EPA 1.1 ({0})", noOfObs), "mean"); Assert.AreEqual(meanExpected, meanActual); }
// 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 UIUpdatesAfterLearnerAddsReflection() { /// 1. Create learner user and login LoginPage LP = Navigation.GoToLoginPage(browser); LRUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR); CBDLearnerPage CLP = LP.LoginAsNewUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); /// 2. Store the number from the label text of the Reflections tab, and also "Showing" label, for the purpose of a future Assert within this /// test. If there are no Reflections yet, this showing label will not appear, so skip it if so CLP.SwitchToTab(CLP.ReflectionsTab, Bys.CBDLearnerPage.ReflectionsTab); string origNumbOfReflectionsOnReflectionsTab = DataUtils.GetStringBetweenCharacters(CLP.ReflectionsTab.Text, "(", ")"); if (browser.Exists(Bys.CBDLearnerPage.ShowingLbl, ElementCriteria.IsVisible)) { string origNumbOfReflectionsOnShowingLbl = DataUtils.GetStringAfterCharacter(CLP.ShowingLbl.Text, "f", 2); } /// 3. Add a reflection LearnerRelectionObject LR = CLP.AddReflection(); /// 4. Assert that the Reflections tab label increased by 1 Assert.AreEqual(Int32.Parse(origNumbOfReflectionsOnReflectionsTab) + 1, Int32.Parse(DataUtils.GetStringBetweenCharacters(CLP.ReflectionsTab.Text, "(", ")"))); /// 5. Assert that the label within the Reflections tab increased by 1 // Bug RCPSC-264: "Learner->Add Reflection: "Showing" label does not update after learner adds reflection" // Uncomment and run the test when fixed if (browser.Exists(Bys.CBDLearnerPage.ShowingLbl, ElementCriteria.IsVisible)) { //Assert.AreEqual(Int32.Parse(origNumbOfReflectionsOnShowingLbl) + 1, Int32.Parse(DataUtils.GetStringAfterCharacter(CLP.ShowingLbl.Text, "f", 2))); } /// 5. Assert that the table contains the reflection Assert.True(ElemGet.Grid_ContainsRecord(browser, CLP.ReflectionsTbl, Bys.CBDLearnerPage.ReflectionsTblBdy, LR.ReflectionTitle, "td", Bys.CBDLearnerPage.TableFirstBtn, Bys.CBDLearnerPage.TableNextBtn)); }
public void ObserverCanCompleteObservation() { /// 1. Create learner and observer users and login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); LRUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR); OBUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.OB); CBDLearnerPage CLP = LP.LoginAsNewUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); /// 2. Request an observation from the observer CLP.RequestObservationForEPA("Transition to Discipline", "Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", OBUser.FullName, "Part A: Direct observation - Form 1"); /// 3. Log out and then log in as the observer that the learner requested CLP.ClickAndWait(CLP.LogoutLnk); Navigation.GoToLoginPage(browser); CBDObserverPage OP = LP.LoginAsNewUser(UserUtils.UserRole.OB, OBUser.Username, OBUser.Password); /// 4. Accept the Pending observation request OP.AcceptOrDeclineAssignment(LRUser.FullName, "Part A: Direct observation - Form 1", "Accept"); /// 5. Open the Complete Assessment form for the observation request and complete the observation OP.CompleteAssessment(LRUser.FullName, "Part A: Direct observation - Form 1"); }
public void LearnerCanAddReflection() { /// 1. Login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, UserUtils.Learner1Login, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Add a reflection LearnerRelectionObject LR = CLP.AddReflection(); }
public void LearnerCanAddReflection() { /// 1. Login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, UserUtils.Learner1Login, "test"); /// 2. Add a reflection LearnerRelectionObject LR = CLP.AddReflection(); }
public void LearnerCanRequestObservation() { /// 1. Login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, UserUtils.Learner1Login, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Request an observation for a specific EPA CLP.RequestObservationForEPA("Transition to Discipline", "Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", UserUtils.Observer1FullName, "Part A: Direct observation - Form 1"); /// 3. Request an observation again for that EPA CLP.RequestObservation(UserUtils.Observer1FullName, "Part A: Direct observation - Form 1"); }
public void DeclinedExpiredTableUpdatesAfterObserverMakesChanges() { /// 1. Create learner and observer users and login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); // We are using a try catch here for the following reason. This test sometimes is the very first test that gets run during the build. For some reason, the // RegisterUser API fails to complete and throws a 500 error whenever the first test gets set off on the grid. So if the error happens, then we will // just call the API again in the Catch block and proceed UserInfo LRUser = null; try { LRUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR); } catch { LRUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR); } OBUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.OB); CBDLearnerPage CLP = LP.LoginAsNewUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); /// 2. Request an observation from the observer CLP.RequestObservationForEPA("Transition to Discipline", "Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", OBUser.FullName, "Part A: Direct observation - Form 1"); /// 3. Log out and then log in as the observer that the learner requested CLP.ClickAndWaitBasePage(CLP.LogoutLnk); Navigation.GoToLoginPage(browser); CBDObserverPage OP = LP.LoginAsNewUser(UserUtils.UserRole.OB, OBUser.Username, OBUser.Password); /// 4. Decline the Pending observation request OP.AcceptOrDeclineAssignment(LRUser.FullName, "Part A: Direct observation - Form 1", "Decline"); OP.ExpandTable(OP.ExpiredDeclinedTblHdr, "", "expand"); Assert.True(ElemGet.Grid_ContainsRecord(Browser, OP.ExpiredDeclinedTbl, Bys.CBDObserverPage.ExpiredDeclinedTblRowBody, 0, LRUser.FullName, "td")); /// 5. Remove the declined request and verify that the table disappears. The table should disappear at this point /// because there was only 1 declined request to begin with OP.RemoveExpiredDeclinedRequest(LRUser.FullName, "Part A: Direct observation - Form 1"); Assert.True(browser.FindElements(Bys.CBDObserverPage.ExpiredDeclinedTblRowBody).Count == 0); /// 6. Switch to the Archived Observations tab and verify that the request shows there OP.SwitchToTab(OP.ArchivedObsTab); Assert.True(ElemGet.Grid_ContainsRecord(Browser, OP.ArchivedObservationsTbl, Bys.CBDObserverPage.ArchivedObservationsTblRowBody, 0, LRUser.FullName, "td")); }
public void ObserverGetsObservationRequestFromLearner() { // TEMPORARY: When the Delete User API is developed, we can remove the below code and uncomment the code below it, which creates new users // on the fly. Decide this when the delete API is complete /// 1. Login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, UserUtils.Learner1Login, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Request an observation from the observer CLP.RequestObservationForEPA("Transition to Discipline", "Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", UserUtils.Observer1FullName, "Part A: Direct observation - Form 1"); /// 3. Log out and then log in as the observer that the learner requested CLP.ClickAndWaitBasePage(CLP.LogoutLnk); Navigation.GoToLoginPage(browser); CBDObserverPage OP = LP.LoginAsExistingUser(UserUtils.UserRole.OB, UserUtils.Observer1Login, ConfigurationManager.AppSettings["LoginPassword"]); /// 4. Check that the observation that was just created is now in the Pending Acceptance table Assert.True(ElemGet.Grid_ContainsRecord(browser, OP.PendingAcceptanceTbl, Bys.CBDObserverPage.PendingAcceptanceTblRowBody, 0, UserUtils.Learner1FullName, "td"), "The observation that was requested from the learner is not showing in the Observer's Pending Acceptance table"); ///// 1. Create learner and observer users and login as the learner //LoginPage LP = Navigation.GoToLoginPage(browser); //LRUser = UserUtils.CreateAndRegisterUser(null, UserUtils.Application.CBD, UserUtils.UserRole.LR); //OBUser = UserUtils.CreateAndRegisterUser(null, UserUtils.Application.CBD, UserUtils.UserRole.OB); //CBDLearnerPage CLP = LP.LoginAsNewUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); ///// 2. Request an observation from the observer //CLP.RequestObservationForEPA(CLP.EPAIMTbl, "Transition to Discipline", // "Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", // OBUser.FullName, "Part A: Direct observation - Form 1"); ///// 3. Log out and then log in as the observer that the learner requested //CLP.ClickAndWaitBasePage(CLP.LogoutLnk); //Navigation.GoToLoginPage(browser); //CBDObserverPage OP = LP.LoginAsNewUser(UserUtils.UserRole.OB, OBUser.Username, OBUser.Password); ///// 4. Check that the observation that was just created is now in the Pending Acceptance table //Assert.True(ElemGet.Grid_ContainsRecord(browser, OP.PendingAcceptanceTbl, LRUser.FullName, null)); }
public void ObvCntGraphUpdatesAfterObserverCompletesAssessment() { /// 1. Create learner and observer users and login as the learner LoginPage LP = Navigation.GoToLoginPage(browser); LRUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR); OBUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.OB); CBDLearnerPage CLP = LP.LoginAsNewUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); /// 2. Store the EPA observation count of EPA1.1 from the graph now, so that when the observer completes an observation, we can Assert /// the EPA observation count increased from this stored count CLP.StoreObvsCntFromEPAObvCntGraph(CLP.EPAObservCntChrt, "EPA 1.1"); /// 3. Request an observation CLP.RequestObservationForEPA("Transition to Discipline", "Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", OBUser.FullName, "Part A: Direct observation - Form 1"); /// 4. Log out and then log in as the observer that the learner requested CLP.ClickAndWait(CLP.LogoutLnk); Navigation.GoToLoginPage(browser); CBDObserverPage OP = LP.LoginAsNewUser(UserUtils.UserRole.OB, OBUser.Username, OBUser.Password); /// 5. Accept the Pending observation request and complete the Assessment form OP.AcceptAndCompleteObservation(LRUser.FullName, "Part A: Direct observation - Form 1"); /// 6. Log out and then log in as the learner CLP.ClickAndWait(CLP.LogoutLnk); Navigation.GoToLoginPage(browser); LP.LoginAsExistingUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); /// 7. Verify that the EPA count has increased on the main graph Assert.AreEqual(CLP.PreviousEPAObvsCntFromEPAObvGraph + 1, CLP.GetEPAObsvCntFromEPAObsGraph(CLP.EPAObservCntChrt, "EPA 1.1"), "The EPA1.1 count on the graph has not increased after the observer completed the observation"); /// 8. Open the Reports form and verify the EPA count on there CLP.ClickAndWait(CLP.ViewMoreRptsLnk); CLP.ReportsFormReportSelElem.SelectByText("EPA Observation Count"); CLP.ClickAndWait(CLP.ReportsFormShowBtn); Assert.AreEqual(CLP.PreviousEPAObvsCntFromEPAObvGraph + 1, CLP.GetEPAObsvCntFromEPAObsGraph(CLP.ReportsFormEPAObservCntChrt, "EPA 1.1"), "The EPA1.1 count on the graph has not increased after the observer completed the observation"); }