- Node (v12.18.3 or higher) [https://nodejs.org/en/download/]
- Git (To download the code from git repo) [https://git-scm.com/download]
- In terminal/Command prompt, go to "a11y-regression-framework/Axe-Report-IGT-Automation" location.
- Execute the command "npm install"
This framework uses the locally development demo app to verify the manual checkpoints. To run this demo app follow below steps.
- Open command prompt.
- Navigate to project root directory
- Execute "npm run start-demo-app" command.
- Open "http://localhost:8080/" in browser.
If you want to change the port number, you can update it in demo-app/server.js.
Note: If you want to do automation on other websites you no need to run demo-app.
This framework will help you to tests the below check points for the given fields in the web page.
- Content on Hover or Focus (1.4.13.a)
- Identify Input Purpose (1.3.5.a)
- Non-Text Contrast - Active User Interface Components (1.4.11.a)
- Non-Text Contrast - Graphical Objects (1.4.11.c)
- Non-Text Contrast - States of User Interface Components (1.4.11.b)
- Status Messages (4.1.3.a)
- Text Spacing (1.4.12.a)
- Create one json file and place it under "/scripted-tests/test-data/" folder. To create this test data file use the template which was described at below section (Data template to provide test data).
- Go to "/scripted-tests/checkpoints-test-runner.json" folder and update the "test-data-file" value with above created file name.
- * npm test
[ { "url": "", "navigationFunction": "", "content-on-hover-or-focus-list": [ { "functionToInvoke": "", "type": "", "value": "" } ], "non-text-contrast-graphic-objects-list": [ { "functionToInvoke": "", "targetElement": { "type": "", "value": "" }, "compareElement": { "type": "", "value": "" } } ], "identify-input-purpose-check-list": [ { "functionToInvoke": "", "type": "", "value": "", "expectedAutoCompleteValue": "" } ], "non-text-contrast-list": [ { "functionToInvoke": "", "targetElement": { "type": "", "value": "" }, "compareElement": { "type": "", "value": "" } } ], "status-messages-list": [ { "functionToInvoke": "", "type": "", "value": "" } ], "text-spacing": { "captureTheBaseImageBeforeTest": false, "nameOfTheImage": "" } } ]
-
url (Mandatory): The test page url on which we want to perform checkpoints check.
-
navigationFunction (Optional): This is the customized function name which user wants to invoke before starting the acutal test execution. The main purpose of this function is it will help the user to navigate to actual state where the user wants to perfom test.
Important point: The function which was mentioned here should be implemented in /scripted-test/navigator.js file.
- content-on-hover-or-focus-list (Optional): If user wants to perform Content on Hover or Focus (1.4.13.a) test then fill this entry.
{ "functionToInvoke": "", "type": "", "value": "" }
- functionToInvoke(optional): Name of the function which use wants to invoke before executing content on hover test of the above element.
- type: Refer headings data format.
- value: Refer headings data format.
- non-text-contrast-graphic-objects-list (optional): If user wants to perform Non-Text Contrast - Active User Interface Components then fill this entry.
{ "functionToInvoke": "", "targetElement": { "type": "", "value": "" }, "compareElement": { "type": "", "value": "" } }
- functionToInvoke(optional): Name of the function which use wants to invoke before executing non text contrast graphic objects list test of the above element.
- targetElement: The graphic element on which we want to perform for color contrast test.
- type: Refer headings data format.
- value: Refer headings data format.
- compareElement: The target element(above element) background color will get compared with this element back gorund color to get the contract ratio.
- type: Refer headings data format.
- value: Refer headings data format.
-
identify-input-purpose-check-list (optional): If user wants to perform Identify Input Purpose check then fill this entry.
{ "functionToInvoke": "", "type": "", "value": "", "expectedAutoCompleteValue": "" }
- functionToInvoke (optional): Custom function to run before executing the test with above parameters.
- type (mandatory): Refer headings data format.
- value (mandatory): Refer headings data format.
-
non-text-contrast-list(optional): If user wants to perform Non-Text Contrast - Active User Interface Components or Non-Text Contrast - States of User Interface Components check then fill this array.
{ "functionToInvoke": "", "targetElement": { "type": "", "value": "" }, "compareElement": { "type": "", "value": "" } }
- functionToInvoke (optional): Custom function to run before executing the test with above parameters.
- targetElement: The element on which we want to perform for color contrast test.
- type: Refer headings data format.
- value: Refer headings data format.
- compareElement: The target element(above element) background color will get compared with the background color of this element to get the contract ratio.
- type: Refer headings data format.
- value: Refer headings data format.
- status-messages-list(optional): If user wants to perform Status Messages check then fill this entry.
{ "functionToInvoke": "", "type": "", "value": "" }
- functionToInvoke (optional): Custom function to run before executing the test with above parameters.
- type: Refer headings data format.
- value: Refer headings data format.
-
text-spacing (optional): If user wants to perform Text Spacing then fill this entry.
- captureTheBaseImageBeforeTest (optional): If the user wants to capture the base image before executing the test then set this field value as "true" or else set it to "false" (False is default value). If this field value is true then the script will take the screenshot of the page and stores it in "/scripted-tests/test-data/base-images/" folder.
- nameOfTheImage (mandatory): Give the name of the image which was stored under "scripted-tests/test-data/base-image" folder.
Note: The very first time you can set "captureTheBaseImageBeforeTest" as "true" and provide some name (test-home-page) to "nameOfTheImage". From next time onwards "captureTheBaseImageBeforeTest" as empty or false just provide nameOfTheImage value. Ex:
[ "url": "http://abcdcomputech.dequecloud.com/", "navigationFunction": "", "text-spacing": { "captureTheBaseImageBeforeTest": true, "nameOfTheImage": "abcd-home-page" } ]