-
Bug
-
Resolution: Fixed
-
Minor
-
3.4.1, 3.5
-
MOODLE_34_STABLE, MOODLE_35_STABLE
-
MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
-
MDL-61204-master -
We see some random failure on "View the participants page as a teacher" in user/tests/behat/view_participants.feature
These are caused by natural sorting of the records changing as these are not actively ordered. In addition, the test checks the "student1" row, but the match is loose, so it matches "student10" (Suspended), and "student11" (Not current).
The easiest solution here would be to replace the match with something more strict, for example the e-mail address. Another solution would be to modify the usernames to have a suffix after the number - e.g. student1s.
To reproduce reliably, update the feature and add And I click on "Email address" "link" on line 230.
Here's an example of the xpath call:
09:44:20.973 INFO - Executing: [find elements: By.xpath: //html/.//tr[contains(normalize-space(.), 'student0x') and not(.//tr[contains(normalize-space(.), 'student0x')])]])
|
Essentially this means that we're matching:
- //html/.//tr - Any tr element with in the top html element
- [contains - which contains, but is not necessarily an exact mach for
- (normalize-space(.), 'student0x') - student0x with the leading, and trailing whitespace removed.