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

Documentation and behat are fighting each other

XMLWordPrintable

    • MOODLE_31_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • wip-mdl-55329
    • 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

      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: :$/

            rajeshtaneja Rajesh Taneja
            daniss Daniele Cordella
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Andrew Lyons Andrew Lyons
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.