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); }
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 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"); }
public void ObserverCanAddObs() { // 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. Create learner and observer user and login as the observer LoginPage LP = Navigation.GoToLoginPage(browser); CBDObserverPage OP = LP.LoginAsExistingUser(UserUtils.UserRole.OB, UserUtils.Observer1Login, "test"); /// 2. Add and complete an observation from the Add Observation form AddedObservationInfo addedObservation = OP.AddObservation(UserUtils.Learner1FullName, "EPA/IM Observation", "1 - Transition to Discipline", "1.1 Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", "Part A: Direct observation - Form 1"); ///// 1. Create learner and observer user and login as the observer //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); //CBDObserverPage OP = LP.LoginAsNewUser(UserUtils.UserRole.OB, OBUser.Username, OBUser.Password); ///// 2. Add and complete an observation from the Add Observation form //AddedObservationInfo addedObservation = OP.AddObservation(LRUser.FullName, "EPA/IM Observation", "1 - Transition to Discipline", //"1.1 Performing preoperative assessments for ASA 1 or 2 patients who will be undergoing a minor scheduled surgical procedure", "Part A: Direct observation - Form 1"); }