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

Behat checkbox controller "clicks" instead of "checks"

    Details

    • Testing Instructions:
      Hide

      Create a Behat test like so:

      @mdl43394
      Feature: Test MDL-43394
       
          Scenario: Why does this not work?
              Given I log in as "admin"
              And I set the following administration settings values:
              | Enable completion tracking | 1 |
              And I log out
      

      This should fail without this patch (and show aforementioned error)

      Show
      Create a Behat test like so: @mdl43394 Feature: Test MDL-43394   Scenario: Why does this not work? Given I log in as "admin" And I set the following administration settings values: | Enable completion tracking | 1 | And I log out This should fail without this patch (and show aforementioned error)
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:

      Description

      I discovered this while writing Behat tests for MDL-40241.

      No matter what I did I could not get the following to work

       And I set the following administration settings values:
          | Enable completion tracking | 1 |
       And I log out
      

      I'd always get the error:

            Exception thrown by (//html//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][@id=//label[contains(normalize-space(.), 'Enable completion tracking')]/@for])[1]
            Unable to submit on a "input" tag.
      

      Digging around in the code I think I found the correct fix

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    13/Jan/14