Overview of Scripts
Scripts in axe Monitor are used to test single-page apps and are used for two primary purposes:
- Session Establishment Tasks: Used to establish a specific state of the page before triggering a crawl, or to test a resultant page. An example for these kind of tasks is logging in to a specific website (establishing session), and then testing a resulting page.
- User Flow Testing Task: Used to test a specific user flow or transaction in which a sequence of operations is needed to get from one screen to the other, and all screens encountered need to be tested for accessibility. These types of tasks include flows related to filling out a multi-step application on a website where forms need to be filled out. Online shopping flow is another example of this task.
In either of the above cases, scripts are required to code for the specific flow that the application must go through. In their simplest form, scripts basically replace a user and help put a website into a particular state for scanning. When an action is performed, the action, and the responses of the application worked with, are recorded as commands in a script.
Scripts can perform most actions that a user can; for example, selecting links, typing text into a field, navigating between pages.
These scripts are written in a specific format and are also called 'Spec Files' in axe Monitor. These script files are written in JSON or YAML format and can be consumed by axe DevTools CLI application. The application can be downloaded from axe Monitor Home screen, under the 'Quick Links' section. These scripts can be created using axe DevTools CLI Spec files using a code editor like Visual Studio Code.
Note: Scripts used for analysis (for both Session Establishment Task or Script Task) must take less than 3 minutes to run the analysis. After 3 minutes, the scan times out. The user can extend this timeout using the Scan Settings - Advanced panel in the Create or Edit Scan wizard, but we do not recommend that the timeout configuration be changed.