Program: 69470
Project: 69470
Buggy source:
/** 
 * An author upload a test, create a course with a test course element, publish the course, add 2 students (Ryomou and Kanu) to the course, configure an assessment.<br /> A first student log in before the assessment is started by the author, the second log-in after the begin of the assessment. Both pass the test. The Author ends the assessment. The two students wait the end of the assessment and go back to normal activities. The author checks the students pass the test in the assessment tool.
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void assessmentMode_manual(@InitialPage LoginPage authorLoginPage,@Drone @Student WebDriver ryomouBrowser,@Drone @Participant WebDriver kanuBrowser) throws IOException, URISyntaxException {
  screenshotTestRule.setBrowsers(browser,ryomouBrowser,kanuBrowser);
  Assume.assumeTrue(browser instanceof FirefoxDriver);
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  UserVO ryomou=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  UserVO kanu=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  String qtiTestTitle="String_Node_Str" + UUID.randomUUID();
  URL qtiTestUrl=JunitTestHelper.class.getResource("String_Node_Str");
  File qtiTestFile=new File(qtiTestUrl.toURI());
  navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle,qtiTestFile);
  String courseTitle="String_Node_Str" + UUID.randomUUID();
  navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
  String testNodeTitle="String_Node_Str";
  CourseEditorPageFragment courseEditor=CoursePageFragment.getCourse(browser).edit();
  courseEditor.createNode("String_Node_Str").nodeTitle(testNodeTitle).selectTabLearnContent().chooseTest(qtiTestTitle);
  courseEditor.publish().quickPublish();
  CoursePageFragment courseRuntime=courseEditor.clickToolbarBack();
  courseRuntime.clickTree().selectWithTitle(testNodeTitle);
  OOGraphene.closeBlueMessageWindow(browser);
  WebElement testH2=browser.findElement(By.cssSelector("String_Node_Str"));
  Assert.assertEquals(testNodeTitle,testH2.getText().trim());
  courseRuntime.members().quickAdd(ryomou);
  courseRuntime.members().quickAdd(kanu);
  LoginPage kanuLoginPage=LoginPage.getLoginPage(kanuBrowser,deploymentUrl);
  kanuLoginPage.loginAs(kanu.getLogin(),kanu.getPassword()).resume();
  Calendar cal=Calendar.getInstance();
  Date begin=cal.getTime();
  cal.add(Calendar.MINUTE,5);
  Date end=cal.getTime();
  String assessmentName="String_Node_Str" + UUID.randomUUID();
  courseRuntime.assessmentConfiguration().createAssessmentMode().editAssessment(assessmentName,begin,end,true).save().start(assessmentName).confirmStart();
  LoginPage ryomouLoginPage=LoginPage.getLoginPage(ryomouBrowser,deploymentUrl);
  ryomouLoginPage.loginAs(ryomou.getLogin(),ryomou.getPassword());
  AssessmentModePage ryomouAssessment=new AssessmentModePage(ryomouBrowser).startAssessment(false);
  CoursePageFragment ryomouTestCourse=new CoursePageFragment(ryomouBrowser);
  ryomouTestCourse.clickTree().selectWithTitle(testNodeTitle);
  QTI12Page.getQTI12Page(ryomouBrowser).passE4(ryomou);
  AssessmentModePage kanuAssessment=new AssessmentModePage(kanuBrowser).startAssessment(true);
  CoursePageFragment kanuTestCourse=new CoursePageFragment(kanuBrowser);
  kanuTestCourse.clickTree().selectWithTitle(testNodeTitle);
  QTI12Page.getQTI12Page(kanuBrowser).passE4(kanu);
  courseRuntime.assessmentConfiguration().stop(assessmentName).confirmStop();
  By continueBy=By.className("String_Node_Str");
  OOGraphene.waitElement(continueBy,10,ryomouBrowser);
  OOGraphene.waitElement(continueBy,10,kanuBrowser);
  kanuAssessment.backToOpenOLAT();
  ryomouAssessment.backToOpenOLAT();
  navBar.openMyCourses().select(courseTitle);
  AssessmentToolPage assessmentTool=new CoursePageFragment(browser).assessmentTool();
  assessmentTool.users().assertOnUsers(ryomou).assertOnUsers(kanu).selectUser(ryomou).assertPassed(ryomou);
}

Fixed version (ground truth):
/** 
 * An author upload a test, create a course with a test course element, publish the course, add 2 students (Ryomou and Kanu) to the course, configure an assessment.<br /> A first student log in before the assessment is started by the author, the second log-in after the begin of the assessment. Both pass the test. The Author ends the assessment. The two students wait the end of the assessment and go back to normal activities. The author checks the students pass the test in the assessment tool.
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void assessmentMode_manual(@InitialPage LoginPage authorLoginPage,@Drone @Student WebDriver ryomouBrowser,@Drone @Participant WebDriver kanuBrowser) throws IOException, URISyntaxException {
  Assume.assumeTrue(browser instanceof FirefoxDriver);
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  UserVO ryomou=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  UserVO kanu=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  String qtiTestTitle="String_Node_Str" + UUID.randomUUID();
  URL qtiTestUrl=JunitTestHelper.class.getResource("String_Node_Str");
  File qtiTestFile=new File(qtiTestUrl.toURI());
  navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle,qtiTestFile);
  String courseTitle="String_Node_Str" + UUID.randomUUID();
  navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
  String testNodeTitle="String_Node_Str";
  CourseEditorPageFragment courseEditor=CoursePageFragment.getCourse(browser).edit();
  courseEditor.createNode("String_Node_Str").nodeTitle(testNodeTitle).selectTabLearnContent().chooseTest(qtiTestTitle);
  courseEditor.publish().quickPublish();
  CoursePageFragment courseRuntime=courseEditor.clickToolbarBack();
  courseRuntime.clickTree().selectWithTitle(testNodeTitle);
  OOGraphene.closeBlueMessageWindow(browser);
  WebElement testH2=browser.findElement(By.cssSelector("String_Node_Str"));
  Assert.assertEquals(testNodeTitle,testH2.getText().trim());
  courseRuntime.members().quickAdd(ryomou);
  courseRuntime.members().quickAdd(kanu);
  LoginPage kanuLoginPage=LoginPage.getLoginPage(kanuBrowser,deploymentUrl);
  kanuLoginPage.loginAs(kanu.getLogin(),kanu.getPassword()).resume();
  Calendar cal=Calendar.getInstance();
  Date begin=cal.getTime();
  cal.add(Calendar.MINUTE,5);
  Date end=cal.getTime();
  String assessmentName="String_Node_Str" + UUID.randomUUID();
  courseRuntime.assessmentConfiguration().createAssessmentMode().editAssessment(assessmentName,begin,end,true).save().start(assessmentName).confirmStart();
  LoginPage ryomouLoginPage=LoginPage.getLoginPage(ryomouBrowser,deploymentUrl);
  ryomouLoginPage.loginAs(ryomou.getLogin(),ryomou.getPassword());
  AssessmentModePage ryomouAssessment=new AssessmentModePage(ryomouBrowser).startAssessment(false);
  CoursePageFragment ryomouTestCourse=new CoursePageFragment(ryomouBrowser);
  ryomouTestCourse.clickTree().selectWithTitle(testNodeTitle);
  QTI12Page.getQTI12Page(ryomouBrowser).passE4(ryomou);
  AssessmentModePage kanuAssessment=new AssessmentModePage(kanuBrowser).startAssessment(true);
  CoursePageFragment kanuTestCourse=new CoursePageFragment(kanuBrowser);
  kanuTestCourse.clickTree().selectWithTitle(testNodeTitle);
  QTI12Page.getQTI12Page(kanuBrowser).passE4(kanu);
  courseRuntime.assessmentConfiguration().stop(assessmentName).confirmStop();
  By continueBy=By.className("String_Node_Str");
  OOGraphene.waitElement(continueBy,10,ryomouBrowser);
  OOGraphene.waitElement(continueBy,10,kanuBrowser);
  kanuAssessment.backToOpenOLAT();
  ryomouAssessment.backToOpenOLAT();
  navBar.openMyCourses().select(courseTitle);
  AssessmentToolPage assessmentTool=new CoursePageFragment(browser).assessmentTool();
  assessmentTool.users().assertOnUsers(ryomou).assertOnUsers(kanu).selectUser(ryomou).assertPassed(ryomou);
}