Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
behat_accessibility Class Reference

Steps definitions to assist with accessibility testing. More...

Inheritance diagram for behat_accessibility:

Public Member Functions

 getSession ($name=null)
 Returns the Mink session.
 
 run_axe_validation_for_tags (string $standardtags='', string $extratags='')
 Run the axe-core accessibility tests.
 

Public Attributes

const PAGE_READY_JS
 The JS code to check that the page is ready.
 

Protected Member Functions

 get_axe_config_for_tags (?array $standardtags=null, ?array $extratags=null)
 Get the configuration to use with Axe.
 
 run_axe_for_tags (array $standardtags=[], array $extratags=[])
 Run the Axe tests.
 

Detailed Description

Steps definitions to assist with accessibility testing.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_axe_config_for_tags()

behat_accessibility::get_axe_config_for_tags ( ?array $standardtags = null,
?array $extratags = null )
protected

Get the configuration to use with Axe.

See https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md for details of the rules.

Parameters
array | null$standardtagsThe list of standard tags to run
array | null$extratagsThe list of tags, in addition to the standard tags, to run
Return values
stringThe JSON-encoded configuration.

◆ getSession()

behat_session_interface::getSession ( $name = null)
inherited

Returns the Mink session.

Parameters
string | null$namename of the session OR active session will be used
Return values
Behat\Mink\Session

Implemented in behat_form_field.

◆ run_axe_for_tags()

behat_accessibility::run_axe_for_tags ( array $standardtags = [],
array $extratags = [] )
protected

Run the Axe tests.

See https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md for details of the supported tags.

Parameters
array$standardtagsThe list of standard tags to run
array$extratagsThe list of tags, in addition to the standard tags, to run

◆ run_axe_validation_for_tags()

behat_accessibility::run_axe_validation_for_tags ( string $standardtags = '',
string $extratags = '' )

Run the axe-core accessibility tests.

There are standard tags to ensure WCAG 2.1 A, WCAG 2.1 AA, and Section 508 compliance. 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/v4.7.2/doc/rule-descriptions.md.

@Then the page should meet accessibility standards @Then the page should meet accessibility standards with :extratags extra tests @Then the page should meet :standardtags accessibility standards

Parameters
string$standardtagsComma-separated list of standard tags to run
string$extratagsComma-separated list of tags to run in addition to the standard tags

Member Data Documentation

◆ PAGE_READY_JS

const behat_session_interface::PAGE_READY_JS
inherited
Initial value:
= "document.readyState === 'complete' && " .
"(typeof M !== 'object' || typeof M.util !== 'object' || " .
"typeof M.util.pending_js === 'undefined' || M.util.pending_js.length === 0)"

The JS code to check that the page is ready.

The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.


The documentation for this class was generated from the following file: