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

Show the correct behat step details in pretty view

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
    • MDL-73883-311
    • MDL-73883-master
    • Hide
      1. Initialise behat
      2. Run behat, ensuring that you include the argument:

        --format="pretty" --out=pretty.txt
        

        For example:

        vendor/bin/behat --format="moodle_progress" --out="std" --format="pretty" --out="pretty.txt" --config=/Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --name="When I am on a named page" 

      3. Tail or open the pretty.txt file:

        tail -f pretty.txt
        

        1. Confirm that on the right of each step you don't just have behat_hooks::i_look_for_exceptions()
          NOTE: You may need to select the output with your cursor because the default colouring SUCKS
        2. Confirm that on the right of each step you have a step name that matches the step description fairly well
      Show
      Initialise behat Run behat, ensuring that you include the argument: --format="pretty" --out=pretty.txt For example: vendor/bin/behat --format="moodle_progress" --out="std" --format="pretty" --out="pretty.txt" --config=/Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --name="When I am on a named page" Tail or open the pretty.txt file: tail -f pretty.txt Confirm that on the right of each step you don't just have behat_hooks::i_look_for_exceptions() NOTE: You may need to select the output with your cursor because the default colouring SUCKS Confirm that on the right of each step you have a step name that matches the step description fairly well

    Description

      This changes the comment syntax in the pretty output to show the actual step that was used instead of the exception check.

      If the exception check passes, then return the result from the step that was actually called instead of the exception result.

      This will make @stronk7 very happy.

      Before:

      Feature: Use core page resolvers for the I am on the page steps
        In order to write tests correctly
        As a developer
        I need to have steps which take me straight to a page
       
        Scenario Outline: When I am on a named page # admin/tool/behat/tests/behat/i_am_on_page.feature:58
          Given I log in as "admin"                 # behat_hooks::i_look_for_exceptions()
          When I am on the <identifier> page        # behat_hooks::i_look_for_exceptions()
          Then I should see "<shouldsee>"           # behat_hooks::i_look_for_exceptions()
       
          Examples:
            | description | identifier            | shouldsee                   |
            | Admin page  | "Admin notifications" | Check for available updates |
            | Home page   | Homepage              | Recently accessed courses   |
       
      2 scenarios (2 passed)
      6 steps (6 passed)
      0m8.72s (49.46Mb)
      

      After:

      Feature: Use core page resolvers for the I am on the page steps
        In order to write tests correctly
        As a developer
        I need to have steps which take me straight to a page
       
        Scenario Outline: When I am on a named page # admin/tool/behat/tests/behat/i_am_on_page.feature:58
          Given I log in as "admin"                 # behat_auth::i_log_in_as()
          When I am on the <identifier> page        # behat_navigation::i_am_on_page()
          Then I should see "<shouldsee>"           # behat_general::assert_page_contains_text()
       
          Examples:
            | description | identifier            | shouldsee                   |
            | Admin page  | "Admin notifications" | Check for available updates |
            | Home page   | Homepage              | Recently accessed courses   |
      

      Attachments

        1. MDL-73883_v39.png
          MDL-73883_v39.png
          109 kB
        2. MDL-73883_v311.png
          MDL-73883_v311.png
          117 kB
        3. MDL-73883_v310.png
          MDL-73883_v310.png
          114 kB
        4. MDL-73883_master.png
          MDL-73883_master.png
          113 kB

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Angelia Dela Cruz Angelia Dela Cruz
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/Mar/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 15 minutes
                  1h 15m