Program: 69479
Project: 69479
Buggy source:
/** 
 * An author create a course, with an enrollment course element. It configure it and create 3 groups and set the maximum enrollment counter to 2<br> One user goes to the course and enrolls in 2 of the groups. It shouldent be possible enroll in the third<br>
 * @param authorLoginPage
 * @param ryomouBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void enrollmentWithMultiEnrollment(@InitialPage LoginPage authorLoginPage,@Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
  screenshotTestRule.setBrowsers(browser,ryomouBrowser);
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  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);
  List<String> groups=new ArrayList<String>();
  groups.add("String_Node_Str" + UUID.randomUUID());
  groups.add("String_Node_Str" + UUID.randomUUID());
  groups.add("String_Node_Str" + UUID.randomUUID());
  EnrollmentConfigurationPage enrolmentConfig=new EnrollmentConfigurationPage(browser);
  enrolmentConfig.selectConfiguration().createBusinessGroup(groups.get(0),"String_Node_Str",4,false,false).createBusinessGroup(groups.get(1),"String_Node_Str",4,false,false).createBusinessGroup(groups.get(2),"String_Node_Str",4,false,false).selectMultipleEnrollments(2);
  courseEditor.publish().quickPublish(Access.users);
  courseEditor.clickToolbarBack();
  for (  String groupName : groups) {
    navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(true,true,false).openMembers();
  }
  LoginPage.getLoginPage(ryomouBrowser,deploymentUrl).loginAs(ryomou).resume();
  NavigationPage participantNavBar=new NavigationPage(ryomouBrowser);
  participantNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
  OOGraphene.waitBusy(ryomouBrowser);
  CoursePageFragment participantCourse=new CoursePageFragment(ryomouBrowser);
  participantCourse.clickTree().selectWithTitle(enNodeTitle);
  EnrollmentPage enrollmentPage=new EnrollmentPage(ryomouBrowser);
  enrollmentPage.assertOnEnrolmentPage().multiEnroll(2);
  enrollmentPage.assertNoEnrollmentAllowed();
}

Fixed version (ground truth):
/** 
 * An author create a course, with an enrollment course element. It configure it and create 3 groups and set the maximum enrollment counter to 2<br> One user goes to the course and enrolls in 2 of the groups. It shouldent be possible enroll in the third<br>
 * @param authorLoginPage
 * @param ryomouBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test @RunAsClient public void enrollmentWithMultiEnrollment(@InitialPage LoginPage authorLoginPage,@Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
  UserVO author=new UserRestClient(deploymentUrl).createAuthor();
  authorLoginPage.loginAs(author.getLogin(),author.getPassword());
  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);
  List<String> groups=new ArrayList<String>();
  groups.add("String_Node_Str" + UUID.randomUUID());
  groups.add("String_Node_Str" + UUID.randomUUID());
  groups.add("String_Node_Str" + UUID.randomUUID());
  EnrollmentConfigurationPage enrolmentConfig=new EnrollmentConfigurationPage(browser);
  enrolmentConfig.selectConfiguration().createBusinessGroup(groups.get(0),"String_Node_Str",4,false,false).createBusinessGroup(groups.get(1),"String_Node_Str",4,false,false).createBusinessGroup(groups.get(2),"String_Node_Str",4,false,false).selectMultipleEnrollments(2);
  courseEditor.publish().quickPublish(Access.users);
  courseEditor.clickToolbarBack();
  for (  String groupName : groups) {
    navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(true,true,false).openMembers();
  }
  LoginPage.getLoginPage(ryomouBrowser,deploymentUrl).loginAs(ryomou).resume();
  NavigationPage participantNavBar=new NavigationPage(ryomouBrowser);
  participantNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
  OOGraphene.waitBusy(ryomouBrowser);
  CoursePageFragment participantCourse=new CoursePageFragment(ryomouBrowser);
  participantCourse.clickTree().selectWithTitle(enNodeTitle);
  EnrollmentPage enrollmentPage=new EnrollmentPage(ryomouBrowser);
  enrollmentPage.assertOnEnrolmentPage().multiEnroll(2);
  enrollmentPage.assertNoEnrollmentAllowed();
}