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

Enable accessibility tests by default during Behat init

    XMLWordPrintable

Details

    • MOODLE_402_STABLE
    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77733-401
    • MDL-77733-master
    • Hide
      1. Init behat with --axe option: php admin/tool/behat/cli/init.php --axe
      2. Verify it displays the message "Axe accessibility tests are enabled by default, to disable use the --no-axe option."
      3. Run the Init script without the --axe option: php admin/tool/behat/cli/init.php
      4. Verify the message above is not displayed.
      5. Edit lib/templates/loginform.mustache and add a duplicate id id="login" attribute on this div tag to simulate an accessibility fail:

        -<div class="loginform">
        +<div class="loginform" id="login">
        

      6. Run the "Login page must be accessible" scenario:
      7. Ensure if fails and the axe accessibility validation error is displayed:

        001 Scenario: Login page must be accessible            # /home/simey/moodles/stable_311/moodle/auth/tests/behat/login.feature:57
              And the page should meet accessibility standards # /home/simey/moodles/stable_311/moodle/auth/tests/behat/login.feature:66
                Accessibility violations found:
                  1 violations of 'Ensures every form element has a label' (severity: critical)
                    - aria-label attribute does not exist or is empty, aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty, Form element does not have an implicit (wrapped) <label>, Form element does not have an explicit <label>, Element has no title attribute or the title attribute is empty:
                      #username
        

      8. Run the init script again with --no-axe option: php admin/tool/behat/cli/init.php --no-axe.
      9. Verify it displays the message "Axe accessibility tests have been disabled."
      10. Run the "Login page must be accessible" scenario again.
      11. Verify the accessibility failure is not displayed.
      Show
      Init behat with --axe option: php admin/tool/behat/cli/init.php --axe Verify it displays the message "Axe accessibility tests are enabled by default, to disable use the --no-axe option." Run the Init script without the --axe option: php admin/tool/behat/cli/init.php Verify the message above is not displayed. Edit lib/templates/loginform.mustache and add a duplicate id id="login" attribute on this div tag to simulate an accessibility fail: -<div class="loginform"> +<div class="loginform" id="login"> Run the "Login page must be accessible" scenario: Ensure if fails and the axe accessibility validation error is displayed: 001 Scenario: Login page must be accessible # /home/simey/moodles/stable_311/moodle/auth/tests/behat/login.feature:57 And the page should meet accessibility standards # /home/simey/moodles/stable_311/moodle/auth/tests/behat/login.feature:66 Accessibility violations found: 1 violations of 'Ensures every form element has a label' (severity: critical) - aria-label attribute does not exist or is empty, aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty, Form element does not have an implicit (wrapped) <label>, Form element does not have an explicit <label>, Element has no title attribute or the title attribute is empty: #username Run the init script again with --no-axe option: php admin/tool/behat/cli/init.php --no-axe . Verify it displays the message "Axe accessibility tests have been disabled." Run the "Login page must be accessible" scenario again. Verify the accessibility failure is not displayed.

    Description

      We should init behat with support for axe by default and remove that option from the CLI script.

      That option was introduced as a precaution but so far no issues have been reported

      Attachments

        1. MDL-77733_1.png
          MDL-77733_1.png
          74 kB
        2. MDL-77733_2.png
          MDL-77733_2.png
          70 kB
        3. MDL-77733_3.png
          MDL-77733_3.png
          93 kB
        4. MDL-77733_4.png
          MDL-77733_4.png
          73 kB
        5. MDL-77733_5.png
          MDL-77733_5.png
          50 kB

        Issue Links

          Activity

            People

              lameze Simey Lameze
              lameze Simey Lameze
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Andrew Lyons Andrew Lyons
              Angelia Dela Cruz Angelia Dela Cruz
              Votes:
              0 Vote for this issue
              Watchers:
              6 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, 1 hour, 44 minutes
                  1d 1h 44m

                  Clockify

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