Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-61204

Random failures in "View the participants page as a teacher"

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Jun Pataleta
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                19/Mar/18