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

Set editor for editor-specific tests

    XMLWordPrintable

Details

    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MDL-75886-master
    • Hide

      Automated tests will ensure that there are no regressions.

      To test that the functionality works, you can deliberately break it:

      1. Ensure that behat is initialised
      2. Open lib/editor/atto/tests/behat/clean.feature in your preferred editor.
      3. In the first Scenario, after the "I click on "When I open my profile in edit mode" step, add:

        And I pause
        

      4. Run the first scenario only, for example:

        ./vendor/bin/behat --config=path/to/config.yml `pwd`/lib/editor/atto/tests/behat/clean.feature:6
        

      5. When the step pauses, take a look at the browser running Behat, and:
        1. Confirm that the editor in use is Atto
      6. Ctrl+C the behat run
      7. Back in your editor
      8. Open lib/editor/atto/tests/behat/behat_editor_atto.php
      9. Find the set_default_editor_flag() function}
      10. Change the last line fo the function to set the default editor to 'tinymce'
      11. Re-run the test
      12. When the step pauses, take a look at the browser running Behat, and:
        1. Confirm that the editor in use has changed to the legacy TinyMCE editor
      13. Ctrl+C the behat run
      14. Open lib/editor/atto/plugins/bold/tests/behat/bold.feature
      15. Remove the @editor_atto tag entirely
      16. Add the same "And I pause" step
      17. Run that scenario from the bold.feature
        1. Confirm that once again the editor was set to TinyMCE
      18. Undo the changes to lib/editor/atto/tests/behat/behat_editor_atto.php
      19. Re-run the test
      20. When the step pauses, take a look at the browser running Behat, and
        1. Confirm that the editor in use has changed back to the Atto editor
      Show
      Automated tests will ensure that there are no regressions. To test that the functionality works, you can deliberately break it: Ensure that behat is initialised Open lib/editor/atto/tests/behat/clean.feature in your preferred editor. In the first Scenario, after the "I click on "When I open my profile in edit mode" step, add: And I pause Run the first scenario only, for example: ./vendor/bin/behat --config=path/to/config.yml `pwd`/lib/editor/atto/tests/behat/clean.feature:6 When the step pauses, take a look at the browser running Behat, and: Confirm that the editor in use is Atto Ctrl+C the behat run Back in your editor Open lib/editor/atto/tests/behat/behat_editor_atto.php Find the set_default_editor_flag() function} Change the last line fo the function to set the default editor to 'tinymce' Re-run the test When the step pauses, take a look at the browser running Behat, and: Confirm that the editor in use has changed to the legacy TinyMCE editor Ctrl+C the behat run Open lib/editor/atto/plugins/bold/tests/behat/bold.feature Remove the @editor_atto tag entirely Add the same "And I pause" step Run that scenario from the bold.feature Confirm that once again the editor was set to TinyMCE Undo the changes to lib/editor/atto/tests/behat/behat_editor_atto.php Re-run the test When the step pauses, take a look at the browser running Behat, and Confirm that the editor in use has changed back to the Atto editor

    Description

      We should make it possible to set the current editor for editor-specific tests.

      This is required as part of MDL-75282, but is a feature useful for other editors on stable branches.

      Attachments

        1. MDL-75886_master_1.png
          MDL-75886_master_1.png
          83 kB
        2. MDL-75886_master_2.png
          MDL-75886_master_2.png
          84 kB
        3. MDL-75886_master_3.png
          MDL-75886_master_3.png
          85 kB
        4. MDL-75886_master_4.png
          MDL-75886_master_4.png
          83 kB
        5. MDL-75886_v311_1.png
          MDL-75886_v311_1.png
          76 kB
        6. MDL-75886_v311_2.png
          MDL-75886_v311_2.png
          70 kB
        7. MDL-75886_v311_3.png
          MDL-75886_v311_3.png
          72 kB
        8. MDL-75886_v311_4.png
          MDL-75886_v311_4.png
          72 kB
        9. MDL-75886_v39_1.png
          MDL-75886_v39_1.png
          71 kB
        10. MDL-75886_v39_2.png
          MDL-75886_v39_2.png
          71 kB
        11. MDL-75886_v39_3.png
          MDL-75886_v39_3.png
          70 kB
        12. MDL-75886_v39_4.png
          MDL-75886_v39_4.png
          74 kB
        13. MDL-75886_v400_1.png
          MDL-75886_v400_1.png
          85 kB
        14. MDL-75886_v400_2.png
          MDL-75886_v400_2.png
          83 kB
        15. MDL-75886_v400_3.png
          MDL-75886_v400_3.png
          85 kB
        16. MDL-75886_v400_4.png
          MDL-75886_v400_4.png
          87 kB

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              Simey Lameze Simey Lameze
              Shamim Rezaie Shamim Rezaie
              Angelia Dela Cruz Angelia Dela Cruz
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 1 day, 2 hours, 30 minutes
                  1d 2h 30m

                  Clockify

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