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

Steps with chains are not dispatching events before and after each of the chained steps

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      You need to understand what are we changing here to test #2:

      1. We are executing actions between steps to ensure all the DOM and the JS is ready, this is done using hooks at step level
      2. A step that returns chained steps is this: http://docs.behat.org/guides/2.definitions.html#step-execution-chaining They are very useful and we use them widely
      3. The hooks are not being executed between the chained steps

      Test 1

      • Run behat locally, all the tests should pass.

      Test 2

      • Run a behat feature using --format pretty
      • Read the .feature file and the output generated by behat
      • For each .feature file step:
        • You should look for the definition of that feature
        • If it is not returning chained steps the step SHOULD appear in the output generated by behat
        • If it is returning chained steps you should find each of the chained step definitions until you find the "lower level" ones (the ones that don't return other steps) and check that they appear on the output
      Show
      You need to understand what are we changing here to test #2: We are executing actions between steps to ensure all the DOM and the JS is ready, this is done using hooks at step level A step that returns chained steps is this: http://docs.behat.org/guides/2.definitions.html#step-execution-chaining They are very useful and we use them widely The hooks are not being executed between the chained steps Test 1 Run behat locally, all the tests should pass. Test 2 Run a behat feature using --format pretty Read the .feature file and the output generated by behat For each .feature file step: You should look for the definition of that feature If it is not returning chained steps the step SHOULD appear in the output generated by behat If it is returning chained steps you should find each of the chained step definitions until you find the "lower level" ones (the ones that don't return other steps) and check that they appear on the output
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-43423_master

      Description

      We use a few chained steps to help with maintenance: http://docs.behat.org/guides/2.definitions.html#step-execution-chaining and I've just realized that they only generate a before event before the step and a after event before the step, but not between all of the chained steps, our hooks are listening to these events, so all our chained steps are not waiting for all the JS to be ready.

      Changes to solve this should go in our moodlehq/behat-extension project, but from moodle codebase we should point to an higher version of https://github.com/moodlehq/moodle-behat-extension

      Pull request in moodle-behat-extension: https://github.com/moodlehq/moodle-behat-extension/pull/2

        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