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

Optimise behat step "i_am_on_course_homepage_with_editing_mode_on"

XMLWordPrintable

    • MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • master_MDL-66907_improve_i_am_on_course_homepage_with_editing_mode_on
    • 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.

      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.

            brudinie guy thomas
            brudinie guy thomas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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