public void PERTraineeAdvancesAllStagesWRequiredMilestones() { // 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 || BrowserName == BrowserNames.Firefox) { /// 1. Create a trainee user, login, complete all required milestones, submit the portfolio // 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.PER, UserUtils.UserRole.TraineePER); PERHelperMethods.AsTrainee_CompleteRequiredMilestones_ThenSubmitPortfolio(browser, newTrainee.Username); /// 2. Log in as a Credential Staff member and assign 2 referees to the trainee PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndRefs(browser, newTrainee.FullName, UserUtils.Referee1PERFullName, UserUtils.Referee2PERFullName); /// 3. Login as the first and then second referee, fill the questionnaire to advance the trainee, click Save and Finish PERHelperMethods.AsReferee_ApproveTrainee(browser, UserUtils.Referee1PERLogin, newTrainee.FullName); PERHelperMethods.AsReferee_ApproveTrainee(browser, UserUtils.Referee2PERLogin, newTrainee.FullName); /// 4. Login as the trainee and verify that the Review Stage says Credentials Unit, and verify that the Referee labels are correct LoginPage LP = Navigation.GoToLoginPage(browser); PERTraineePage TP = LP.LoginAsExistingUser(UserUtils.UserRole.TraineePER, newTrainee.Username, ConfigurationManager.AppSettings["LoginPassword"]); Assert.AreEqual(TP.ReviewStageValueLbl.Text, "Credentials Unit"); Assert.AreEqual(TP.Referee1PERValueLbl.Text.Trim(), UserUtils.Referee1PERFullName); Assert.AreEqual(TP.Referee2PERValueLbl.Text.Trim(), UserUtils.Referee2PERFullName); LP.Logout(); /// 5. Log in as a Credential Staff member, click on Assign assessors, then assign 2 assessors PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndAssessors(browser, newTrainee.FullName, UserUtils.Assessor1PERFullName, UserUtils.Assessor2PERFullName); /// 6. Login as both assessors and mark all milestones as achieved. PERHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor1PERLogin, newTrainee.FullName); PERHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor2PERLogin, newTrainee.FullName); /// 7. Login as the CU and mark the trainee as Not Achieved for a final review PERHelperMethods.AsCredentialStaff_MarkTraineeAsAchievedOrNotAchieved(browser, newTrainee.FullName, true); /// 8. Login as the trainee and verify that the Review Stage says Achieved LoginPage LP2 = Navigation.GoToLoginPage(browser); PERTraineePage TP2 = LP2.LoginAsExistingUser(UserUtils.UserRole.TraineePER, newTrainee.Username, ConfigurationManager.AppSettings["LoginPassword"]); Assert.AreEqual(TP2.ReviewStageValueLbl.Text, "Achieved"); } }
public void PERTraineeAdvancesAllStagesWRequiredMilestones() { // 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 || BrowserName == BrowserNames.Firefox) { /// 1. Create a trainee user, login, complete all required milestones, submit the portfolio UserInfo newTrainee = new UserInfo(); newTrainee = UserUtils.CreateAndRegisterUser(UserUtils.Application.PER, UserUtils.UserRole.TraineePER); PERHelperMethods.AsTrainee_CompleteRequiredMilestones_ThenSubmitPortfolio(browser, newTrainee.Username); /// 2. Log in as a Credential Staff member and assign 2 referees to the trainee PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndRefs(browser, newTrainee.FullName, UserUtils.Referee1PERFullName, UserUtils.Referee2PERFullName); /// 3. Login as the first and then second referee, fill the questionnaire to advance the trainee, click Save and Finish PERHelperMethods.AsReferee_ApproveTrainee(browser, UserUtils.Referee1PERLogin, newTrainee.FullName); PERHelperMethods.AsReferee_ApproveTrainee(browser, UserUtils.Referee2PERLogin, newTrainee.FullName); /// 4. Login as the trainee and verify that the Review Stage says Credentials Unit, and verify that the Referee labels are correct LoginPage LP = Navigation.GoToLoginPage(browser); PERTraineePage TP = LP.LoginAsExistingUser(UserUtils.UserRole.TraineePER, newTrainee.Username, "test"); Assert.AreEqual(TP.ReviewStageValueLbl.Text, "Credentials Unit"); Assert.AreEqual(TP.Referee1PERValueLbl.Text.Trim(), UserUtils.Referee1PERFullName); Assert.AreEqual(TP.Referee2PERValueLbl.Text.Trim(), UserUtils.Referee2PERFullName); LP.Logout(); /// 5. Log in as a Credential Staff member, click on Assign assessors, then assign 2 assessors PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndAssessors(browser, newTrainee.FullName, UserUtils.Assessor1PERFullName, UserUtils.Assessor2PERFullName); /// 6. Login as both assessors and mark all milestones as achieved. PERHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor1PERLogin, newTrainee.FullName); PERHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor2PERLogin, newTrainee.FullName); /// 7. Login as the CU and mark the trainee as Not Achieved for a final review PERHelperMethods.AsCredentialStaff_MarkTraineeAsAchievedOrNotAchieved(browser, newTrainee.FullName, true); /// 8. Login as the trainee and verify that the Review Stage says Achieved LoginPage LP2 = Navigation.GoToLoginPage(browser); PERTraineePage TP2 = LP2.LoginAsExistingUser(UserUtils.UserRole.TraineePER, newTrainee.Username, "test"); Assert.AreEqual(TP2.ReviewStageValueLbl.Text, "Achieved"); } }
public void PERTraineeGets3rdAssessorAndGetsMarksNotAchieved() { // 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 all milestones, submit the portfolio UserInfo newTrainee = new UserInfo(); newTrainee = UserUtils.CreateAndRegisterUser(UserUtils.Application.PER, UserUtils.UserRole.TraineePER); PERHelperMethods.AsTrainee_CompleteRequiredMilestones_ThenSubmitPortfolio(browser, newTrainee.Username); /// 2. Log in as a Credential Staff member and assign 2 referees to the trainee PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndRefs(browser, newTrainee.FullName, UserUtils.Referee1PERFullName, UserUtils.Referee2PERFullName); /// 3. Login as the first and then second referee, fill the questionnaire to advance the trainee, click Save and Finish PERHelperMethods.AsReferee_ApproveTrainee(browser, UserUtils.Referee1PERLogin, newTrainee.FullName); PERHelperMethods.AsReferee_ApproveTrainee(browser, UserUtils.Referee2PERLogin, newTrainee.FullName); /// 4. Log in as a Credential Staff member, click on Assign assessors, then assign 2 assessors PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndAssessors(browser, newTrainee.FullName, UserUtils.Assessor1PERFullName, UserUtils.Assessor2PERFullName); /// 5. Login as both assessors. For the first assessor, mark all milestones as achieved. For the other, mark 1 of the milestones as /// Not Achieved PERHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor1PERLogin, newTrainee.FullName); PERHelperMethods.AsAssessor_RejectTrainee(browser, UserUtils.Assessor2PERLogin, newTrainee.FullName); /// 6. Login as a Credential Staff member, and assign a third referee PERHelperMethods.AsCredentialStaff_AssignTraineeTo3rdAssessor(browser, newTrainee.FullName, UserUtils.Assessor3PERFullName); /// 7. Login as the 3rd assessor and approve the trainee PERHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor3PERLogin, newTrainee.FullName); /// 8. Login as the CU and mark the trainee as Not Achieved for a final review PERHelperMethods.AsCredentialStaff_MarkTraineeAsAchievedOrNotAchieved(browser, newTrainee.FullName, false); /// 9. Login as the trainee and verify that the Review Stage says Not Achieved LoginPage LP = Navigation.GoToLoginPage(browser); PERTraineePage TP = LP.LoginAsExistingUser(UserUtils.UserRole.TraineePER, newTrainee.Username, ConfigurationManager.AppSettings["LoginPassword"]); Assert.AreEqual(TP.ReviewStageValueLbl.Text, "Not Achieved"); } }
public void PERTraineeAndAssessorAdditionalInfoFeature() { // 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 all milestones, and submit the portfolio UserInfo newTrainee = new UserInfo(); newTrainee = UserUtils.CreateAndRegisterUser(UserUtils.Application.PER, UserUtils.UserRole.TraineePER); List <string> milestoneNames = PERHelperMethods.AsTrainee_CompleteAllMilestones_ThenSubmitPortfolio(browser, newTrainee.Username); /// 2. Log in as a Credential Staff member and assign 2 referees to the trainee PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndRefs(browser, newTrainee.FullName, UserUtils.Referee1PERFullName, UserUtils.Referee2PERFullName); /// 3. Login as the first and then second referee, fill the questionnaire to advance the trainee, click Save and Finish PERHelperMethods.AsReferee_ApproveTrainee(browser, UserUtils.Referee1PERLogin, newTrainee.FullName); PERHelperMethods.AsReferee_ApproveTrainee(browser, UserUtils.Referee2PERLogin, newTrainee.FullName); /// 4. Log in as a Credential Staff member, click on Assign assessors, then assign 2 assessors PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndAssessors(browser, newTrainee.FullName, UserUtils.Assessor1PERFullName, UserUtils.Assessor2PERFullName); /// 5. Login as both assessors. For the first assessor, mark all milestones as achieved. For the second assessor, request additional information /// from the trainee. PERHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor1PERLogin, newTrainee.FullName); PERHelperMethods.AsAssessor_RequestAdditionalInfo(browser, UserUtils.Assessor2PERLogin, newTrainee.FullName, milestoneNames[0]); /// 6. Login as the trainee and then send the additional information to the assessor string additionalInfo = "here is the additional info"; PERHelperMethods.AsTrainee_SendAdditionalInfo(browser, newTrainee.Username, milestoneNames[0], additionalInfo); /// 7. Login as the assessor and verify that the assessor got the additional information Assert.True(PERHelperMethods.AsAssessor_VerifyAdditionalInfo(browser, UserUtils.Assessor2PERLogin, newTrainee.FullName, milestoneNames[0], additionalInfo)); /// 8. Advance the trainee to Achieved PERHelperMethods.AsAssessor_ApproveTrainee(browser, UserUtils.Assessor2PERLogin, newTrainee.FullName); PERHelperMethods.AsCredentialStaff_MarkTraineeAsAchievedOrNotAchieved(browser, newTrainee.FullName, true); } }
//[Test] public void sandboxtest() { PERHelperMethods.AsCredentialStaff_AssignTraineeTo1stAnd2ndRefs(browser, "TTA_Trainee _6I654D2FDe5H", UserUtils.Referee1PERFullName, UserUtils.Referee2PERFullName); }