Пример #1
0
        public void DiplomaTraineeAdvancesAllStagesWRequiredMilestones()
        {
            // Ignoring this test in IE and Firefox because this test needs to upload files. See the following document
            // explaining why we can not do that in these browsers: https://code.premierinc.com/docs/display/PGHLMSDOCS/General
            if (BrowserName == BrowserNames.Chrome)
            {
                /// 1. Create a trainee user, login, complete and assign all required milestones to a clinical supervisor
                // We are using a try catch here for the following reason. This test is one of 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 newTrainee = new UserInfo();
                try
                {
                    newTrainee = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR);
                }
                catch
                {
                    newTrainee = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR);
                }
                newTrainee = UserUtils.CreateAndRegisterUser(UserUtils.Application.Diploma, UserUtils.UserRole.TraineeDiploma);
                DiplomaHelperMethods.AsTrainee_SubmitAllRequiredMilestones(browser, newTrainee.Username, UserUtils.ClinicalSupervisor1DiplomaFullName);

                /// 2. As the CS, mark the trainee's portfolio is achieved
                DiplomaHelperMethods.AsCS_MarkAllMilestonesAchieved(browser, UserUtils.ClinicalSupervisor1DiplomaLogin, newTrainee.FullName);

                /// 3. As the trainee, submit the portfolio
                DiplomaHelperMethods.AsTrainee_SubmitPortfolio(browser, newTrainee.Username);

                /// 4. As the diploma director, mark the trainee's portfolio as achieved
                DiplomaHelperMethods.AsDD_MarkPortfolioAsAchieved(browser, UserUtils.DiplDirector1DiplomaLogin, newTrainee.FullName);

                /// 5. As the faculty of medicine, mark the trainee's portfolio as achieved
                DiplomaHelperMethods.AsFacOfMed_MarkMarkPortfolioAAsAchieved(browser, UserUtils.FacultyOfMed1DiplomaLogin, newTrainee.FullName);

                /// 6. As the credential staff unit, mark the trainee as achieved, record a payment, and assign 2 assessors
                DiplomaHelperMethods.AsCU_MarkAsAchievedRecordPaymentAndAssign2Assessors(browser, newTrainee.FullName, UserUtils.Assessor1DiplomaFullName, UserUtils.Assessor2DiplomaFullName);

                /// 7. As both assessors, mark all of the trainee's milestones as achieved
                DiplomaHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor1DiplomaLogin, newTrainee.FullName);
                DiplomaHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor2DiplomaLogin, newTrainee.FullName);

                /// 8. As the credential staff unit, make a final review and mark the trainee as achieved
                DiplomaHelperMethods.AsCU_MakeFinalReview_MarkAchieved(browser, newTrainee.FullName);

                /// 9. Login as the trainee, and verify that the Review Stage label has been updated to Achieved
                LoginPage          LP = Navigation.GoToLoginPage(browser);
                DiplomaTraineePage TP = LP.LoginAsExistingUser(UserUtils.UserRole.TraineeDiploma, newTrainee.Username, ConfigurationManager.AppSettings["LoginPassword"]);
                Assert.AreEqual(TP.ReviewStageValueLbl.Text, "Achieved");
            }
        }
Пример #2
0
        public void DiplomaTraineeGets3rdAssessorAndGetsMarksNotAchieved()
        {
            // Ignoring this test in IE and Firefox because this test needs to upload files. See the following document
            // explaining why we can not do that in these browsers: https://code.premierinc.com/docs/display/PGHLMSDOCS/General
            if (BrowserName == BrowserNames.Chrome)
            {
                /// 1. Create a trainee user, login, complete and assign all milestones to a clinical supervisor
                UserInfo newTrainee = new UserInfo();
                newTrainee = UserUtils.CreateAndRegisterUser(UserUtils.Application.Diploma, UserUtils.UserRole.TraineeDiploma);
                DiplomaHelperMethods.AsTrainee_SubmitAllMilestones(browser, newTrainee.Username, UserUtils.ClinicalSupervisor1DiplomaFullName);

                /// 2. As the CS, mark the trainee's portfolio is achieved
                DiplomaHelperMethods.AsCS_MarkAllMilestonesAchieved(browser, UserUtils.ClinicalSupervisor1DiplomaLogin, newTrainee.FullName);

                /// 3. As the trainee, submit the portfolio
                DiplomaHelperMethods.AsTrainee_SubmitPortfolio(browser, newTrainee.Username);

                /// 4. As the diploma director, mark the trainee's portfolio as achieved
                DiplomaHelperMethods.AsDD_MarkPortfolioAsAchieved(browser, UserUtils.DiplDirector1DiplomaLogin, newTrainee.FullName);

                /// 5. As the faculty of medicine, mark the trainee's portfolio as achieved
                DiplomaHelperMethods.AsFacOfMed_MarkMarkPortfolioAAsAchieved(browser, UserUtils.FacultyOfMed1DiplomaLogin, newTrainee.FullName);

                /// 6. As the credential staff unit, mark the trainee as achieved, record a payment, and assign 2 assessors
                DiplomaHelperMethods.AsCU_MarkAsAchievedRecordPaymentAndAssign2Assessors(browser, newTrainee.FullName, UserUtils.Assessor1DiplomaFullName, UserUtils.Assessor2DiplomaFullName);

                /// 7. Login as both assessors. For the first assessor, mark all milestones as achieved. For the other, mark 1 of the milestones as
                /// Not Achieved
                DiplomaHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor1DiplomaLogin, newTrainee.FullName);
                DiplomaHelperMethods.AsAssessor_RejectTrainee(browser, UserUtils.Assessor2DiplomaLogin, newTrainee.FullName);

                /// 8. Login as a Credential Staff member, and assign a third referee
                DiplomaHelperMethods.AsCredentialStaff_AssignTraineeTo3rdAssessor(browser, newTrainee.FullName, UserUtils.Assessor3DiplomaFullName);

                /// 9. Login as the 3rd assesor and approve the trainee
                DiplomaHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor3DiplomaLogin, newTrainee.FullName);

                /// 10. As the credential staff unit, make a final review and mark the trainee as not achieved
                DiplomaHelperMethods.AsCU_MakeFinalReview_MarkNotAchieved(browser, newTrainee.FullName);

                /// 11. Login as the trainee, and verify that the Review Stage label has been updated to Not Achieved
                LoginPage          LP = Navigation.GoToLoginPage(browser);
                DiplomaTraineePage TP = LP.LoginAsExistingUser(UserUtils.UserRole.TraineeDiploma, newTrainee.Username, "test");
                Assert.AreEqual(TP.ReviewStageValueLbl.Text, "Not Achieved");
            }
        }