Testing with the CLI
Pre-requisites
Visit the Getting Started page to learn how to setup the CLI in your project.
Scanning
A Website
Escaping the url
Wrapping the URL with single quotes is an easy way to avoid issues with the shell interpreting special characters.
npx aetest scan 'https://www.audioeye.com'
A Local Document
- Standard Input (STDIN)
- Absolute File Path
npx aetest scan < example_inputs/document.html
npx aetest scan "file://${PWD}/example_inputs/document.html"
By default, the CLI will expect a document to be a complete HTML document. If you are scanning a component, you can use
the -c
flag to run in component mode.
Scan Output
::: START AudioEye Accessibility Testing SDK CLI :::
Scanning HTML from STDIN
Rendered page content in 0.005 seconds
Running accessibility tests
Tests run in 0.1 seconds
AudioEye Rules Version: 8.3.5
Found 3 accessibility issues
Img_Name_Missing - count: 3
Test results were written to aetest_output.html
::: END AudioEye Accessibility Testing SDK CLI :::
Scanning Components
npx aetest scan --component < example_inputs/component.html
Option Flags for Scanning
Usage: aetest scan [options] [url]
Perform an accessibility scan on a URL or on the provided raw html on stdin
Arguments:
url Optional URL to scan, if not provided HTML is read from stdin
Options:
-c, --component Run in component mode (create a document and inject the HTML)
-p, --print-test-list Print the list of tests that will be run
-d, --debug Internal Use only (Don't build off of this!)
-f, --format <file_type> Define the file type of the output (html, json or csv) (default: "html")
-o, --output <filename> Define the file path for test results output, default is ./aetest_results.<file_type>
-s, --stdout Output full results to stdout as well as a file, this will replace the summary output normally shown on stdout
-t, --timeout <seconds> Set the timeout for DOM rendering in seconds, default is 5 (default: "5")
-v, --viewport-dimensions <width>x<height> Set the viewport dimensions for the browser (width and height separated by "x")
-m, --mobile Set the viewport to a mobile device. Customize with --viewport-dimensions.
--css, --css-selectors Compute CSS selectors for elements with accessibility issues
-h, --help display help for command
HTML Output
Once you've run a scan, the test results will be added to an HTML document at the file path specified in the output. Here is an example result: