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

Documentation and behat are fighting each other

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Run following behat and ensure it passes behat:
        • mod/data/tests/behat/required_entries.feature
      2. Remove : (colon) applied by this patch in feature file and run feature again
        1. Ensure passes on stables
        2. Ensure failure on master
      3. Set $CFG->behat_usedeprecated to true, and run again on master
        1. Ensure passes on master
      Show
      Run following behat and ensure it passes behat: mod/data/tests/behat/required_entries.feature Remove : (colon) applied by this patch in feature file and run feature again Ensure passes on stables Ensure failure on master Set $CFG->behat_usedeprecated to true, and run again on master Ensure passes on master
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:
      wip-mdl-55329

      Description

      Documentation and behat are fighting each other.

      In https://docs.moodle.org/dev/Acceptance_testing#Providing_values_to_steps
      I read

      A PyString; is a multiline string, most commonly used to fill out forms when a newline is required. Like steps with tables, steps which require PyStrings will end with ":"
      

      Take care to: steps which require PyStrings will end with ":"
      but in:
      lib/tests/behat/behat_forms.php

      I found

          /**
           * Sets the specified value to the field.
           *
           * @Given /^I set the field "(?P<field_string>(?:[^"]|\\")*)" to multiline$/
           * @throws ElementNotFoundException Thrown by behat_base::find
           * @param string $field
           * @param PyStringNode $value
           * @return void
           */
          public function i_set_the_field_to_multiline($field, PyStringNode $value) {
              $this->set_field_value($field, (string)$value);
          }
      

      with

           * @Given /^I set the field "(?P<field_string>(?:[^"]|\\")*)" to multiline$/
      

      instead of

           * @Given /^I set the field "(?P<field_string>(?:[^"]|\\")*)" to multiline:$/
      

      Take care to: :$/

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Sep/16