# a11y-regression-framework **Repository Path**: mirrors_dequelabs/a11y-regression-framework ## Basic Information - **Project Name**: a11y-regression-framework - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-23 - **Last Updated**: 2026-11-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # IGT AUTOMATION FRAMEWORK ## REQUIREMENTS 1. Node (v12.18.3 or higher) [https://nodejs.org/en/download/] 2. Git (To download the code from git repo) [https://git-scm.com/download] ## SETUP 1. In terminal/Command prompt, go to **"a11y-regression-framework/Axe-Report-IGT-Automation"** location. 2. Execute the command **"npm install"** ## STEPS TO USE 1. Navigate to the directory "IGTData", Place expected data JSON files for every IGT in the respected folders(Refer to 'Expected data format' section to create expected data JSON files) 2. Navigate to data/configuration.json file, Update targetAppUrl with the test page URL.
"targetAppUrl": "http://mytestpage.com" 3. Add expected data JSON file names as key values in the same file.
"headingIGTTestData": "test-headings.json", "pageInformationIGTTestData": "test-page-information.json", "keyboardIGTTestData": "test-keyboard.json" 4. Execute the command to run the tests **"npm test"** ## EXPECTED DATA FORMAT ### Page Information
Create a json file at /IGTData/pageInformation folder using below template and name it as ***-page-information.json
Expected JSON Template:{
"pageTitle": "/"test page title/"",
"majorContentLanguageOfThePage": "Test page language(ex: English)"
}
Create a json file at /IGTData/headings folder using below template and name it as ***-headings.json
Expected JSON Array Template:[{
"type": "",
"value": "",
"headerText": "heading1"
},
{
"type": "",
"value": "",
"headerText": "heading2"
},
.
.
.
{
"type": "",
"value": "",
"headerText": "headingN"
}
]
**type** : This will represent strategy to identify the element in the web page, The value of this key should be any of the below,
1. css
2. id
3. class
4. xpath
**value**: Element locator value. Ex: #username, .classname
**headerText**: Expected heading text for the above element.
To create test data json file we use axe expert extension. In the browser open your web page along with axe expert extension and follow below steps.
Create a json file at /IGTData/modal folder using below template and name it as ***-modal.json
Expected JSON Array Template:{
"type": "",
"value": "",
"isThisModalHasLauncher": true,
"canThisModalDismissed": true,
"closeButton": {
"type": "",
"value": ""
},
"afterModalCloseFocusMovedEle": {
"type": "",
"value": ""
},
"lunchedModalEle": {
"type": "",
"value": ""
}
}
**type**: This the modal launcher element locator strategy type, for more details refere headings data format.
**value**: Refer headings data format.
**isThisModalHasLauncher**: Boolean - If the testing modal has a launcher then mention it as true or mention it as false.
**canThisModalDismissed**: Boolean - If this modal is dismissable by pressing on Esc key then mention it as true or else mention it as false.
**closeButton**: It is an optional one, if the modal is not dismissed by pressing on Esc key then provide this value.
**afterModalCloseFocusMovedEle**Json object - Once the modal closed either by pressing on Esc or by clicking on close button then where should be focus moved."headingIGTTestData": "",
[
{
"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": ""
}
}
]
### Template keys description:
1. url (Mandatory): The test page url on which we want to perform checkpoints check.
2. 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.
3. 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.
4. 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.
5. 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.
6. 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.
7. 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.
8. 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"
}
]