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

Optimise behat step "i_am_on_course_homepage_with_editing_mode_on"

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.6.6, 3.7.2, 3.8.1
    • Fix Version/s: None
    • Labels:
    • Testing Instructions:
      Hide

      Run the following behat tests prior to this optimisation:

      mod/label/tests/behat/label_visibility.feature

      mod/workshop/tests/behat/grade_to_pass.feature

      Run the same behat tests post optimisation

      Expectation - tests all pass and take less time after the optimisation has been applied.

      NOTE: It is important that you run the tests with exactly the same load on the machine. It really does need to be a propert 'test' envrionment for it to be fair.

      Show
      Run the following behat tests prior to this optimisation: mod/label/tests/behat/label_visibility.feature mod/workshop/tests/behat/grade_to_pass.feature Run the same behat tests post optimisation Expectation - tests all pass and take less time after the optimisation has been applied. NOTE: It is important that you run the tests with exactly the same load on the machine. It really does need to be a propert 'test' envrionment for it to be fair.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      master_MDL-66907_improve_i_am_on_course_homepage_with_editing_mode_on

      Description

      The behat step "i_am_on_course_homepage_with_editing_mode_on" in behat_navigation.php is used many times throughout the code base.

      However, checking that editing can be switched on via a button should only be tested once as it is slow.

      For the rest of the time, the behat test should simply navigate directly to the appropriate url with edit=on as a parameter. This is much faster.

      It's also important to note that there is already a step to simpy turn editing on so there is no need to write this code again or even test it again (i_turn_editing_mode_on in behat_course.php).

      For optimal performance with behat testing there should be two types of step a) A UI test step where it actually clicks on stuff - this only needs to be implemented once as a test per feature b) A performant utility step that gets you to where you need to be as quickly as possible.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brudinie guy thomas
              Reporter:
              brudinie guy thomas
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 minutes
                  2m