Program: 69468
Project: 69468
Buggy source:
/** 
 * An author upload a test, create a course with a test course element, publish the course and do and pass the test.
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void qti12Test(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
  screenshotTestRule.setBrowsers(browser);
  Assume.assumeTrue(browser instanceof FirefoxDriver);
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  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();
  courseEditor.clickToolbarBack().clickTree().selectWithTitle(testNodeTitle);
  WebElement testH2=browser.findElement(By.cssSelector("String_Node_Str"));
  Assert.assertEquals(testNodeTitle,testH2.getText().trim());
  QTI12Page testPage=QTI12Page.getQTI12Page(browser);
  testPage.start().selectItem(0).answerSingleChoice(0).saveAnswer().selectItem(1).answerMultipleChoice(0,2).saveAnswer().selectItem(2).answerKPrim(true,false,true,false).saveAnswer().selectItem(3).answerFillin("String_Node_Str").saveAnswer();
  testPage.endTest();
  By resultsBy=By.id("String_Node_Str");
  OOGraphene.waitElement(resultsBy,browser);
  WebElement resultsEl=browser.findElement(resultsBy);
  Assert.assertTrue(resultsEl.getText().contains(author.getFirstName()));
  testPage.closeTest();
  WebElement passedEl=browser.findElement(By.cssSelector("String_Node_Str"));
  Assert.assertTrue(passedEl.isDisplayed());
}

Fixed version (ground truth):
/** 
 * An author upload a test, create a course with a test course element, publish the course and do and pass the test.
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void qti12Test(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
  Assume.assumeTrue(browser instanceof FirefoxDriver);
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  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();
  courseEditor.clickToolbarBack().clickTree().selectWithTitle(testNodeTitle);
  WebElement testH2=browser.findElement(By.cssSelector("String_Node_Str"));
  Assert.assertEquals(testNodeTitle,testH2.getText().trim());
  QTI12Page testPage=QTI12Page.getQTI12Page(browser);
  testPage.start().selectItem(0).answerSingleChoice(0).saveAnswer().selectItem(1).answerMultipleChoice(0,2).saveAnswer().selectItem(2).answerKPrim(true,false,true,false).saveAnswer().selectItem(3).answerFillin("String_Node_Str").saveAnswer();
  testPage.endTest();
  By resultsBy=By.id("String_Node_Str");
  OOGraphene.waitElement(resultsBy,browser);
  WebElement resultsEl=browser.findElement(resultsBy);
  Assert.assertTrue(resultsEl.getText().contains(author.getFirstName()));
  testPage.closeTest();
  WebElement passedEl=browser.findElement(By.cssSelector("String_Node_Str"));
  Assert.assertTrue(passedEl.isDisplayed());
}