Skip to content

Commit

Permalink
MDL-79674 behat: Bump axe-core to v4.8.4
Browse files Browse the repository at this point in the history
* Improve readme_moodle.txt and add more detailed instructions
* Update \behat_accessibility::run_axe_validation_for_tags()'s
  PHPDoc block to reflect the current version.
* Fix incorrect copyright tag for the library
  • Loading branch information
junpataleta committed Feb 16, 2024
1 parent d3ad77e commit f47baad
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/behat/axe/axe.min.js

Large diffs are not rendered by default.

23 changes: 19 additions & 4 deletions lib/behat/axe/readme_moodle.txt
Expand Up @@ -2,16 +2,31 @@ Description of axe import into Moodle

1/ Download the latest axe code somewhere (example /tmp/axe) using:

mkdir -p axe/node_modules
npm install --prefix axe axe-core --save-dev
mkdir -p /tmp/axe
cd /tmp/axe
npm install axe-core --save-dev

Note down the version number displayed by the command, to update lib/thirdpartylibs.xml accordingly.

If the command does not output a version number, the version number can be found in package.json. You can simply open package.json
using your desired editor and look for the version number of axe-core. Alternatively, you may use the following commands:
- MacOS:
cat package.json | grep axe-core
- Linux:
cat package.json | grep '"version"' | awk -F '"' '{print $4}'
or
jq -r '.version' package.json

2/ Copy the following file to your local Moodle directory, to replace the old one:

cp axe/node_modules/axe-core/axe.min.js [PATH TO YOUR MOODLE]/lib/behat/axe/
cp /tmp/axe/node_modules/axe-core/axe.min.js [PATH TO YOUR MOODLE]/lib/behat/axe/

3/ Update lib/thirdpartylibs.xml with the new version number.

4/ Update the PHPDoc block of \behat_accessibility::run_axe_validation_for_tags() in
[PATH TO YOUR MOODLE]/lib/tests/behat/behat_accessibility.php to reflect the new version number.

3/ Run behat tests labelled with @accessibility and confirm they are passing with the new library version, or fix the failures
5/ Run behat tests labelled with @accessibility and confirm they are passing with the new library version, or fix the failures
because the new version might raise issues that weren't detected previously:

php admin/tool/behat/cli/init.php --add-core-features-to-theme
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/behat/behat_accessibility.php
Expand Up @@ -46,7 +46,7 @@ class behat_accessibility extends behat_base {
* It is also possible to specify any desired optional tags.
*
* The list of available tags can be found at
* https://github.com/dequelabs/axe-core/blob/v3.5.5/doc/rule-descriptions.md.
* https://github.com/dequelabs/axe-core/blob/v4.8.4/doc/rule-descriptions.md.
*
* @Then the page should meet accessibility standards
* @Then the page should meet accessibility standards with :extratags extra tests
Expand Down
4 changes: 2 additions & 2 deletions lib/thirdpartylibs.xml
Expand Up @@ -17,12 +17,12 @@
<location>behat/axe</location>
<name>axe-core</name>
<description>Accessibility testing engine for websites and other HTML-based user interfaces.</description>
<version>4.7.2</version>
<version>4.8.4</version>
<license>MPL</license>
<licenseversion>2.0</licenseversion>
<repository>https://github.com/dequelabs/axe-core</repository>
<copyrights>
<copyright>2005, Jon Papaioannou</copyright>
<copyright>Deque Systems, Inc.</copyright>
</copyrights>
</library>
<library>
Expand Down

0 comments on commit f47baad

Please sign in to comment.