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

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Jun Pataleta Jun Pataleta
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              19/Mar/18