Features
Update Scan Name
Scans uploaded to the dashboard from axe DevTools Mobile for Appium are named using the screen's name or title when avaialble. You can set the name to something more specific using the scanName
key within the settings dictionary.
const axeSettings = {
apiKey: '<your-api-key-here>',
scanName: '<your-scan-name-here>'
}
const result = await driver.execute('mobile: axeScan', axeSettings)
Ignore Rules
You can ignore select rules while scanning. To do this, add the key ignoreRules
to the configuration settings object and set its value to an array containing the IDs of the rules you want to ignore. Each string in the array should be a valid ruleId
- in the example below you can see the ColorContrast and ScreenTitle rules. Find all ruleId
s inside of the axeConf
object in the JSON result for any scan.
const axeSettings = {
apiKey: "<your-api-key-here>",
ignoreRules: ["ColorContrast", "ScreenTitle"]
}
const result = await driver.execute('mobile: axeScan', axeSettings)
Ignore Experimental Rules
Experimental rules are not yet part of a standard ruleset and are considered beta results. You may elect to ignore all experimental rules during scanning. Add the ignoreExperimental
key and set its value to true. This will allow you to scan without being affected by any experimental rules.
const axeSettings = {
apiKey: "<your-api-key-here>",
ignoreExperimental: true
}
const result = await driver.execute('mobile: axeScan', axeSettings)
Tagging Results
Tagging is a helpful feature to organize, share and search for scans within the axe DevTools Mobile Dashboard. Some helpful tags for your team may be the team name, build number, simulator version, etc.
Tagged scans are visible to everyone within your organization, whereas scans without tags are visible only to the user that created them.
Send a Scan with a Tag
Add the key tags
with the value of any tag you'd like to add. The below example will push a scan to the dashboard with two tags, "v0.0.1" and "iOS 17.4". Note it can be added to the settings object with or without the scanName
key.
const axeSettings = {
apiKey: '<your-api-key-here>',
scanName: '<your-scan-name-here>',
tags: ['v0.0.1', 'iOS 17.4']
}
const result = await driver.execute('mobile: axeScan', axeSettings)
Upload to Dashboard
You can now disable posting scan results to the dashboard, to reduce the number of network requests and improve scan speed. The default value of uploadToDashboard
is true. Set this value to false to disable the upload.
const axeSettings = {
apiKey: "<your-api-key-here>",
uploadToDashboard: false
}
const result = await driver.execute('mobile: axeScan', axeSettings)
Build Scan URL from AxeResultKey
When you upload your scan, the scan result returned from the driver has the axeResultKey
object. This object has three properties: packageName
, userId
, and resultId
. Using these properties, you can create the URL directing to the uploaded scan results on the Mobile Dashboard. This can be useful for customized reports, or if you want to output the scan result link in your tests. Use the following as a guide for the scan URL structure:
${dashboardHomeURL}/scan?userId=${userId}&packageName=${packageName}&resultId=${resultId}
Example
const axeSettings = {
apiKey: "<your-api-key-here>"
}
const result = await driver.execute('mobile: axeScan', axeSettings)
const { packageName, userId, resultId } = result.axeResultKey;
const dashboardBaseURL = "https://axe-mobile.deque.com";
const url = new URL('/scan', dashboardBaseURL);
url.searchParams.append('userId', userId);
url.searchParams.append('packageName', packageName);
url.searchParams.append('resultId', resultId);
console.info(`View scan here: ${url.toString()}.`);