public void UIUpdatesAfterUserMeetsSectionCreditMinimumRequirement() { /// 1. Create a Mainport user and Login UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP); LoginPage LP = Navigation.GoToLoginPage(browser); MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Submit an activity in each section, ensuring that 25 credits have been met in each section EnterCPDActivityPage EAP = DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity ConferenceAct = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "25", true); DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity FellowshipAct = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec2_Fellowship_FixedCredits25); DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity MultiSourceFeedbackAct = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec3_MultisourceFeedback_CreditsTripled, "10"); // Have to wait for the credits to be applied before we can proceed MainportHelperMethods.WaitForCreditsToBeApplied(browser, DP, Bys.MyDashboardPage.TotalCreditsAppliedValueLbl, "80"); /// 3. Verify that the MOC Section Requirements labels show as blue/gray, and that the checkmark shows for each box Assert.AreEqual("showGrey", DP.MOCSectionReqsGraphGroupLearningSquare.GetAttribute("class")); Assert.AreEqual("showGrey", DP.MOCSectionReqsGraphSelfLearningSquare.GetAttribute("class")); Assert.AreEqual("showGrey", DP.MOCSectionReqsGraphAssessmentSquare.GetAttribute("class")); Assert.True(DP.MOCSectionReqsGraphGroupLearningTickBox.Displayed); Assert.True(DP.MOCSectionReqsGraphSelfLearningTickBox.Displayed); Assert.True(DP.MOCSectionReqsGraphAssessmentTickBox.Displayed); /// 4. Go to the My MOC tab and verify that the "section minimum requirement was met" label is shown DP.ClickAndWaitBasePage(DP.MyMOCTab); Assert.True(Browser.Exists(Bys.MyMOCPage.GroupLearnTblYouHaveMetMinCredsLbl, ElementCriteria.IsVisible)); Assert.True(Browser.Exists(Bys.MyMOCPage.SelfLearningTblYouHaveMetMinCredsLbl, ElementCriteria.IsVisible)); Assert.True(Browser.Exists(Bys.MyMOCPage.AssessmentTblYouHaveMetMinCredsLbl, ElementCriteria.IsVisible)); }
public void UserCanDeleteActivityOnMyMOCPage() { /// 1. Create a Mainport user and Login UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP); LoginPage LP = Navigation.GoToLoginPage(browser); MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Enter 2 activities EnterCPDActivityPage EAP = DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity ConferenceActivity = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "10", false); DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity ConferenceActivity2 = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "10", false); // Have to wait for the credits to be applied before we can proceed MainportHelperMethods.WaitForCreditsToBeApplied(browser, DP, Bys.MyDashboardPage.TotalCreditsAppliedValueLbl, "10"); /// 3. On the My MOC page, open the View Activity form, click the X button for an activity, and verify that it got removed from the table MyMOCPage MP = DP.ClickAndWaitBasePage(DP.MyMOCTab); MP.OpenViewActivitiesForm(MP.GroupLearnTblUnaccrActRowViewLnk); IWebElement row = ElemGet.Grid_GetRowByRowName(MP.ViewActivitiesFormActivitiesTbl, Bys.MyMOCPage.ViewActivitiesFormActivitiesTblBodyRow, ConferenceActivity.ActivityName, "td"); ElemSet.Grid_ClickElementWithoutTextInsideRow(row, "input"); MP.ClickAndWait(MP.DeleteActivityWarningFormYesBtn); Assert.False(ElemGet.Grid_ContainsRecord(Browser, MP.ViewActivitiesFormActivitiesTbl, Bys.MyMOCPage.ViewActivitiesFormActivitiesTblBodyRow, 0, ConferenceActivity.ActivityName, "td")); }
public void UserCanEditActivityOnMyMOCPage() { /// 1. Create a Mainport user and Login UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP); LoginPage LP = Navigation.GoToLoginPage(browser); MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Enter an activity EnterCPDActivityPage EAP = DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity NewConferenceActivity = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "20", true); /// 3. Click to the MyMOC page, click on the View link for the activity that was created, click on the Pencil icon in the Activities table on the popup, /// then verify that the information on this form is correct // Gotta wait for the windows service first to apply the credits MainportHelperMethods.WaitForCreditsToBeApplied(browser, DP, Bys.MyDashboardPage.TotalCreditsAppliedValueLbl, "20"); MyMOCPage MP = DP.ClickAndWaitBasePage(DP.MyMOCTab); MP.OpenEditActivityForm(MP.GroupLearnTblAccrActRowViewLnk, NewConferenceActivity.ActivityName); /// 4. Edit the activity. Change accredited to not accredited. Change the credits from 20 to 10. Change the name. Close the form. Verify that the /// amount of credits gets updated on all related labels, verify that the activity was moved from the accredited table to the not accredited table, /// and verify the name change Activity EditedConferenceActivity = EAP.EditActivity(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "10", false); Browser.SwitchTo().DefaultContent(); MP.ClickAndWaitBasePage(MP.MyDashboardTab); MainportHelperMethods.WaitForCreditsToBeApplied(browser, DP, Bys.MyDashboardPage.TotalCreditsAppliedValueLbl, "5"); // Overall label DP.ClickAndWaitBasePage(DP.MyMOCTab); Assert.AreEqual("5 of 400", MP.OverallCreditsAppliedLbl.Text); // Credits Applied to Date labels Assert.AreEqual(EditedConferenceActivity.Credits + " Credits", MP.GroupLearnTblCreditsAppliedValueLbl.Text); // Credits Reported column Assert.AreEqual("-", MP.GroupLearnTblAccrActRowCredsRptLbl.Text); Assert.AreEqual(EditedConferenceActivity.Credits, MP.GroupLearnTblUnaccrActRowCredsRptLbl.Text); /// 5. Click back to the Dashboard page and verify that the credit amount change is reflected there MP.ClickAndWaitBasePage(MP.MyDashboardTab); Assert.AreEqual("5", DP.TotalCreditsSubmittedValueLbl.Text); Assert.AreEqual("5", DP.TotalCreditsAppliedValueLbl.Text); }
public void CreditLabelVerification() { // Not runing firefox right now due to Lifetime support Actions button being a hover dropdown. Revisit this and fix in firefox, // Will probably just need to add a line of code to hover over Actions instead of clicking on it. if (BrowserName == BrowserNames.Chrome || BrowserName == BrowserNames.InternetExplorer) { /// 1. Create a Mainport user and Login UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP); LoginPage LP = Navigation.GoToLoginPage(browser); MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Add at least 1 activity for each activity type /// 3. Choose 1 activity which cuts the credits in half per hour/article when the No radio button is clicked. EnterCPDActivityPage EAP = DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity ConferenceActivity = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "10", false); /// 4. Choose 1 activity which has a fixed amount of credits DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity FellowshipActivity = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec2_Fellowship_FixedCredits25); /// 5. Choose 1 activity which triples credits DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity AccreditedSelAssessActivity = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec3_AccreditedSelfAssessmentPrograms_CreditsTripled, "10"); /// 6. Choose 1 activity that requires validation DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity BulkJournalActivity = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec2_BulkJournalReadingwithTranscript_ValidationRequired, "10"); /// 7. Log on to the Lifetime Support site and validate the credit LSHelp.Login(browser, "lkaveti", "password"); LSHelp.ValidateCredit(browser, "Royal College of Physicians", NewUser.FullName, "Maintenance of Certification", BulkJournalActivity.ActivityName); /// 8. Go back to the Mainport app, and on the My Dashboard page, verify that the Total Credits Submitted and Applied labels reflect the amount of /// credits that were added above. Also verify the "MOC Section Requirements" graph labels get reflected. Based on the above activites, the /// Submitted label should have 5 for Conference, + 25 for fellowship, + 30 for accreditedselfassess, + 10 for bulkjournal. So total we should see 70 Navigation.GoToMyDashboardPage(browser); MainportHelperMethods.WaitForCreditsToBeApplied(browser, DP, Bys.MyDashboardPage.TotalCreditsAppliedValueLbl, "70"); Assert.AreEqual("70", DP.TotalCreditsSubmittedValueLbl.Text); Assert.AreEqual("70", DP.TotalCreditsAppliedValueLbl.Text); Assert.AreEqual(string.Format("Section 1Group Learning{0}/25 Credits", ConferenceActivity.Credits), DP.MOCSectionReqsGraphGroupLearningCreditLbl.GetAttribute("textContent")); int totalSelfLearningCredits = Int32.Parse(FellowshipActivity.Credits) + Int32.Parse(BulkJournalActivity.Credits); // For the Section 2 Self Learning activities, we completed 2 of them, so we have to add those 2 credits to get the total label Assert.AreEqual(string.Format("Section 2Self Learning{0}/25 Credits", totalSelfLearningCredits.ToString()), DP.MOCSectionReqsGraphSelfLearningCreditLbl.GetAttribute("textContent")); Assert.AreEqual(string.Format("Section 3Assessment{0}/25 Credits", AccreditedSelAssessActivity.Credits), DP.MOCSectionReqsGraphAssessmentCreditLbl.GetAttribute("textContent")); /// 9. On the My MOC page, verify that the credits are reflected in the Overall label, reflected in each Credits Applied to Date labels, /// and in each row under the Credits Reported column MyMOCPage MP = DP.ClickAndWaitBasePage(DP.MyMOCTab); // Overall label Assert.AreEqual("70 of 400", MP.OverallCreditsAppliedLbl.Text); // Credits Applied to Date labels Assert.AreEqual(ConferenceActivity.Credits + " Credits", MP.GroupLearnTblCreditsAppliedValueLbl.Text); Assert.AreEqual(totalSelfLearningCredits.ToString() + " Credits", MP.SelfLearningTblCreditsAppliedValueLbl.Text); Assert.AreEqual(AccreditedSelAssessActivity.Credits + " Credits", MP.AssessmentTblCreditsAppliedValueLbl.Text); // Credits Reported column Assert.AreEqual(ConferenceActivity.Credits, MP.GroupLearnTblUnaccrActRowCredsRptLbl.Text); Assert.AreEqual(FellowshipActivity.Credits, MP.SelfLearningTblPlanLearnActRowCredsRptLbl.Text); Assert.AreEqual(BulkJournalActivity.Credits, MP.SelfLearningTblScanActRowCredsRptLbl.Text); Assert.AreEqual(AccreditedSelAssessActivity.Credits, MP.AssessmentTblKnowledgeAssRowCredsRptLbl.Text); /// 10. Click on the View link for one of the activities, verify the credits are reflected correctly on the popup, click the Pencil icon /// to view the activity in read-only mode to verify that it appears MP.OpenViewActivitiesForm(MP.GroupLearnTblUnaccrActRowViewLnk); Assert.AreEqual(ElemGet.Grid_GetCellTextByRowNameAndColumnName(MP.ViewActivitiesFormActivitiesTbl, MP.ViewActivitiesFormActivitiesTblThead, Bys.MyMOCPage.ViewActivitiesFormActivitiesTblBody, ConferenceActivity.ActivityName, "td", "Credits Reported"), ConferenceActivity.Credits); MP.ClickAndWait(MP.ViewActivitiesFormCloseBtn); } }