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

Behat: Given I enrol - stopped working in 3.1

    XMLWordPrintable

    Details

      Description

      When a Behat test contains the step like

      And I enrol "Studie One" user as "Student"
      

      in non-javascript session, the step fails with error

      "Field matching locator "'Assign roles'" not found."
      

      This is a regression of MDL-53381 commit eb9ca848. In the previous version, there were chained steps that contained steps:

      $steps[] = new Given('I set the field "' . get_string('assignroles', 'role') . '" to "' . $rolename . '"');
      

      and

      $steps[] = new Given('I set the field "' . get_string('assignrole', 'role') . '" to "' . $rolename . '"');
      

      for javascript and non-javascript, respectively. Note the difference in the string identier "assignroles" (js) and "assignrole" (non-js).

      Rajesh Taneja did not notice this tiny difference (no surprise) and replaced both chained steps with single API call using the "assignroles" identifier. Which causes the step to fail in non-js session.

      This was not discovered so far because no core test uses this step in non-javascript session.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mudrd8mz David Mudrák (@mudrd8mz)
                Reporter:
                mudrd8mz David Mudrák (@mudrd8mz)
                Peer reviewer:
                Rajesh Taneja
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16