Beispiel #1
0
        public void MainCyclNotCompleteAfter399Credits()
        {
            /// 1. Create a Mainport user, which has a cycle start date 6 years prior, then Login. We are using a date 6 years in the past because
            /// the end date of the cycle needs to be a past date for the user to be able to advance, and the Main cycle is 5 years
            UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP, null, null,
                                                               DateTime.Now.AddYears(-6).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
            LoginPage       LP = Navigation.GoToLoginPage(browser);
            MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]);

            /// 2. Submit an activity totalling 399 credits, Enter an activity date that falls within the cycle date range.
            /// NOTE: If the activity date falls within cycle date's the last year for a Main cycle, then we wont need to credit validate
            string actDate                     = DateTime.Now.AddYears(-1).ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
            EnterCPDActivityPage EAP           = DP.ClickAndWait(DP.EnterACPDActivityBtn);
            Activity             ConferenceAct = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "399", true, actDate);

            /// 3. Login to Lifetime Support and validate the credits that need validated, if applicable. See note above in step 2 about credit validation.
            /// Depending on what day of the year this test is run, it may need credit validation
            LSHelp.Login(browser, "lkaveti", "password");
            LSHelp.GoToParticipantProgramPage(browser, "Royal College of Physicians", NewUser.FullName, "Maintenance of Certification");
            MainportHelperMethods.ValidateCreditsIfApplicable(browser, NewUser, ConferenceAct);

            /// 4. Click on the Details tab and verify that the UI displays In Progress for the Status label, since we did not reach the 400 credits
            // First we have to wait for the windows service to process the credits.
            LSHelp.WaitForProgramCreditsWindowsService(browser, "399 (of 400)");
            Assert.AreEqual("In Progress", LSHelp.GetProgramDetail(browser, "Status"));
        }
Beispiel #2
0
        public void MainCycleAdvancesToMain2CycleAfter400Credits()
        {
            // Not running this test on Feb 1st of any year, because Mainport has some weird gracce period rule where the user gets auto-advanced without
            // the Admin having to manually advance him, so it messes with the test
            if (DateTime.Now.Date.ToString() != "2/1/2018 12:00:00 AM")
            {
                /// 1. Create a Mainport user, which has a cycle start date 6 years prior, then Login. We are using a date 6 years in the past because
                /// the end date of the cycle needs to be a past date for the user to be able to advance, and the Main cycle is 5 years
                UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP, null, null,
                                                                   DateTime.Now.AddYears(-6).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
                LoginPage       LP = Navigation.GoToLoginPage(browser);
                MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]);

                /// 2. Submit an activity totalling 400 credits, Enter an activity date that falls within the cycle date range.
                /// NOTE: If the activity date falls within the cycle date's last year for a Main cycle, then we wont need to credit validate
                string actDate                     = DateTime.Now.AddYears(-1).ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                EnterCPDActivityPage EAP           = DP.ClickAndWait(DP.EnterACPDActivityBtn);
                Activity             ConferenceAct = EAP.AddActivityThenSubmit(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "400", true, actDate);

                /// 3. Login to Lifetime Support and validate the credit that needs validated, if applicable. See note above in step 2 about credit validation.
                /// Depending on what day of the year this test is run, it may need credit validation
                LSHelp.Login(browser, "lkaveti", "password");
                LSHelp.GoToParticipantProgramPage(browser, "Royal College of Physicians", NewUser.FullName, "Maintenance of Certification");
                MainportHelperMethods.ValidateCreditsIfApplicable(browser, NewUser, ConferenceAct);

                /// 4. Click on the Details tab and verify that the UI displays Complete for the Status label
                // First we have to wait for the windows service to process the credits.
                LSHelp.WaitForProgramCreditsWindowsService(browser, "400 (of 400)");
                Assert.AreEqual("Complete", LSHelp.GetProgramDetail(browser, "Status"));

                /// 5. Add a Main cycle adjustment, then verify that the UI displays In Progress for the Status label, and "Main 2nd or Later Cycle" for the
                /// program label. NOTE: We can not automate the "automatic" cycle advacement because it relies on a windows service that gets run overnight.
                /// Going from Main 1 to Main2/EXT, etc. usually occurs automatically for clients with the overnight windows service. We are sort of hacking
                /// the system by manually setting this user to Main 2, and not truly testing that a user gets put into Main 2 once he meets his credit
                /// minimum. Basically, you can place a user into any cycle through LTS, even if the user did not meet credit minimum
                LSHelp.RCP_AddProgramAdjustment(browser, NewUser.FullName, LSConstants.AdjustmentCodes.MainProgram, DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
                Assert.AreEqual(DateTime.Now.ToString("M/d/yyyy", CultureInfo.InvariantCulture), LSHelp.GetProgramDetail(browser, "Starts"));
                Assert.AreEqual("Main 2nd or Later Cycle", LSHelp.GetProgramDetail(browser, "Program"));

                /// 6. Go back to Mainport and verify that the user is in a new cycle by checking that the credits reset to 0
                Navigation.GoToMyDashboardPage(browser);
                Assert.AreEqual("0", DP.TotalCreditsSubmittedValueLbl.Text);
                Assert.AreEqual("0", DP.TotalCreditsAppliedValueLbl.Text);
            }
        }