Program: 69480
Project: 69480
Buggy source:
/** 
 * An author create a course, with an enrollment course element. It configure it and create a group with max. participant set to 1 and enables the waiting list.<br> Three users goes to the course and try to enroll. One will become a participant, the 2 others land in the waiting list.
 * @param authorLoginPage
 * @param ryomouBrowser
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void enrollmentWithWaitingList(@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();
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  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");
  String courseTitle="String_Node_Str" + UUID.randomUUID();
  navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
  String enNodeTitle="String_Node_Str";
  CourseEditorPageFragment courseEditor=CoursePageFragment.getCourse(browser).edit();
  courseEditor.createNode("String_Node_Str").nodeTitle(enNodeTitle);
  String groupName="String_Node_Str" + UUID.randomUUID();
  EnrollmentConfigurationPage enrolmentConfig=new EnrollmentConfigurationPage(browser);
  enrolmentConfig.selectConfiguration().createBusinessGroup(groupName,"String_Node_Str",1,true,false);
  courseEditor.publish().quickPublish(Access.users);
  courseEditor.clickToolbarBack();
  GroupPage authorGroup=navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(true,true,true).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());
  }
  authorGroup.openMembers();
  int participants=0;
  int waitingList=0;
  for (  Enrollment enrollment : participantDrivers) {
    if (authorGroup.isInMembersParticipantList(enrollment.getUser()))     participants++;
    if (authorGroup.isInMembersInWaitingList(enrollment.getUser()))     waitingList++;
  }
  Assert.assertEquals(1,participants);
  Assert.assertEquals(2,waitingList);
}

Fixed version (ground truth):
/** 
 * An author create a course, with an enrollment course element. It configure it and create a group with max. participant set to 1 and enables the waiting list.<br> Three users goes to the course and try to enroll. One will become a participant, the 2 others land in the waiting list.
 * @param authorLoginPage
 * @param ryomouBrowser
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void enrollmentWithWaitingList(@InitialPage LoginPage authorLoginPage,@Drone @User WebDriver ryomouBrowser,@Drone @Participant WebDriver reiBrowser,@Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  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");
  String courseTitle="String_Node_Str" + UUID.randomUUID();
  navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
  String enNodeTitle="String_Node_Str";
  CourseEditorPageFragment courseEditor=CoursePageFragment.getCourse(browser).edit();
  courseEditor.createNode("String_Node_Str").nodeTitle(enNodeTitle);
  String groupName="String_Node_Str" + UUID.randomUUID();
  EnrollmentConfigurationPage enrolmentConfig=new EnrollmentConfigurationPage(browser);
  enrolmentConfig.selectConfiguration().createBusinessGroup(groupName,"String_Node_Str",1,true,false);
  courseEditor.publish().quickPublish(Access.users);
  courseEditor.clickToolbarBack();
  GroupPage authorGroup=navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(true,true,true).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());
  }
  authorGroup.openMembers();
  int participants=0;
  int waitingList=0;
  for (  Enrollment enrollment : participantDrivers) {
    if (authorGroup.isInMembersParticipantList(enrollment.getUser()))     participants++;
    if (authorGroup.isInMembersInWaitingList(enrollment.getUser()))     waitingList++;
  }
  Assert.assertEquals(1,participants);
  Assert.assertEquals(2,waitingList);
}