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

Behat checkbox controller "clicks" instead of "checks"

    XMLWordPrintable

Details

    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • 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)

    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

      Attachments

        Issue Links

          Activity

            People

              sry_not4sale Aaron Barnes
              sry_not4sale Aaron Barnes
              David Monllaó David Monllaó
              Dan Poltawski Dan Poltawski
              Michael de Raadt Michael de Raadt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Jan/14