Program: 69478
Project: 69478
Buggy source:
/** 
 * An author create a course and a business group in the members management. It has max. participants set to 1 and no waiting list. Than it returns in the course editor to create an enrollment course element. It configure it and select the group created before.<br> Three users goes to the course and try to enroll. One will become a participant, the 2 others get an error message.
 * @param authorLoginPage
 * @param ryomouBrowser
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void enrollment(@InitialPage LoginPage authorLoginPage,@Drone @User WebDriver ryomouBrowser,@Drone @Participant WebDriver reiBrowser,@Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
  screenshotTestRule.setBrowsers(browser,ryomouBrowser,reiBrowser,kanuBrowser);
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  UserVO rei=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  UserVO kanu=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  UserVO ryomou=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  String courseTitle="String_Node_Str" + UUID.randomUUID();
  navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
  String groupName="String_Node_Str" + UUID.randomUUID();
  CoursePageFragment authorCourse=CoursePageFragment.getCourse(browser);
  MembersPage membersPage=authorCourse.members().selectBusinessGroups().createBusinessGroup(groupName,"String_Node_Str",1,false,false);
  navBar.openCourse(courseTitle);
  authorCourse=membersPage.clickToolbarBack();
  String enNodeTitle="String_Node_Str";
  CourseEditorPageFragment courseEditor=authorCourse.edit().createNode("String_Node_Str").nodeTitle(enNodeTitle);
  EnrollmentConfigurationPage enrolmentConfig=new EnrollmentConfigurationPage(browser);
  enrolmentConfig.selectConfiguration().selectBusinessGroups();
  courseEditor.publish().quickPublish(Access.users);
  GroupPage authorGroup=navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(false,true,false).openMembers().assertParticipantList();
  Enrollment[] participantDrivers=new Enrollment[]{new Enrollment(ryomou,ryomouBrowser),new Enrollment(rei,reiBrowser),new Enrollment(kanu,kanuBrowser)};
  for (  Enrollment enrollment : participantDrivers) {
    WebDriver driver=enrollment.getDriver();
    LoginPage.getLoginPage(driver,deploymentUrl).loginAs(enrollment.getUser()).resume();
    NavigationPage participantNavBar=new NavigationPage(driver);
    participantNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
    CoursePageFragment participantCourse=new CoursePageFragment(driver);
    participantCourse.clickTree().selectWithTitle(enNodeTitle);
    EnrollmentPage enrollmentPage=new EnrollmentPage(driver);
    enrollmentPage.assertOnEnrolmentPage();
    enrollment.setEnrollmentPage(enrollmentPage);
  }
  for (  Enrollment enrollment : participantDrivers) {
    enrollment.getEnrollmentPage().enrollNoWait();
  }
  for (  Enrollment enrollment : participantDrivers) {
    OOGraphene.waitBusy(enrollment.getDriver());
  }
  int errors=0;
  for (  Enrollment enrollment : participantDrivers) {
    if (enrollment.getEnrollmentPage().hasError()) {
      errors++;
    }
  }
  authorGroup.openMembers();
  int participants=0;
  for (  Enrollment enrollment : participantDrivers) {
    if (authorGroup.isInMembersParticipantList(enrollment.getUser())) {
      participants++;
    }
  }
  Assert.assertEquals(1,participants);
  Assert.assertEquals(participantDrivers.length - 1,errors);
}

Fixed version (ground truth):
/** 
 * An author create a course and a business group in the members management. It has max. participants set to 1 and no waiting list. Than it returns in the course editor to create an enrollment course element. It configure it and select the group created before.<br> Three users goes to the course and try to enroll. One will become a participant, the 2 others get an error message.
 * @param authorLoginPage
 * @param ryomouBrowser
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void enrollment(@InitialPage LoginPage authorLoginPage,@Drone @User WebDriver ryomouBrowser,@Drone @Participant WebDriver reiBrowser,@Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  UserVO rei=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  UserVO kanu=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  UserVO ryomou=new UserRestClient(deploymentUrl).createRandomUser("String_Node_Str");
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  String courseTitle="String_Node_Str" + UUID.randomUUID();
  navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
  String groupName="String_Node_Str" + UUID.randomUUID();
  CoursePageFragment authorCourse=CoursePageFragment.getCourse(browser);
  MembersPage membersPage=authorCourse.members().selectBusinessGroups().createBusinessGroup(groupName,"String_Node_Str",1,false,false);
  navBar.openCourse(courseTitle);
  authorCourse=membersPage.clickToolbarBack();
  String enNodeTitle="String_Node_Str";
  CourseEditorPageFragment courseEditor=authorCourse.edit().createNode("String_Node_Str").nodeTitle(enNodeTitle);
  EnrollmentConfigurationPage enrolmentConfig=new EnrollmentConfigurationPage(browser);
  enrolmentConfig.selectConfiguration().selectBusinessGroups();
  courseEditor.publish().quickPublish(Access.users);
  GroupPage authorGroup=navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(false,true,false).openMembers().assertParticipantList();
  Enrollment[] participantDrivers=new Enrollment[]{new Enrollment(ryomou,ryomouBrowser),new Enrollment(rei,reiBrowser),new Enrollment(kanu,kanuBrowser)};
  for (  Enrollment enrollment : participantDrivers) {
    WebDriver driver=enrollment.getDriver();
    LoginPage.getLoginPage(driver,deploymentUrl).loginAs(enrollment.getUser()).resume();
    NavigationPage participantNavBar=new NavigationPage(driver);
    participantNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
    CoursePageFragment participantCourse=new CoursePageFragment(driver);
    participantCourse.clickTree().selectWithTitle(enNodeTitle);
    EnrollmentPage enrollmentPage=new EnrollmentPage(driver);
    enrollmentPage.assertOnEnrolmentPage();
    enrollment.setEnrollmentPage(enrollmentPage);
  }
  for (  Enrollment enrollment : participantDrivers) {
    enrollment.getEnrollmentPage().enrollNoWait();
  }
  for (  Enrollment enrollment : participantDrivers) {
    OOGraphene.waitBusy(enrollment.getDriver());
  }
  int errors=0;
  for (  Enrollment enrollment : participantDrivers) {
    if (enrollment.getEnrollmentPage().hasError()) {
      errors++;
    }
  }
  authorGroup.openMembers();
  int participants=0;
  for (  Enrollment enrollment : participantDrivers) {
    if (authorGroup.isInMembersParticipantList(enrollment.getUser())) {
      participants++;
    }
  }
  Assert.assertEquals(1,participants);
  Assert.assertEquals(participantDrivers.length - 1,errors);
}