Create a URL for Scan Results
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
, resultId
, and uuid
. Using the first three properties, you can create the URL directing to the uploaded results for a single scan 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:
${dashboardHBaseURL}/scan?userId=${userId}&packageName=${packageName}&resultId=${resultId}
The snippet below shows how you can build a URL for a single scan with JavaScript:
const axeSettings = {
apiKey: "<your-api-key-here>"
}
const result = await driver.execute('mobile: axeScan', axeSettings)
const { packageName, userId, resultId, uuid } = 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()}.`);
Build Scan Group URL from AxeResultKey
As mentioned above, the AxeResultKey
has four properties: packageName
, userId
, resultId
, and uuid
. Using the uuid
property, you can create a URL directing to a group of scan results (up to 20) on the Mobile Dashboard. Use the following JavaScript snippet as a guide for the scan URL structure:
let uuidList = [];
// As you iterate through all test cases, add the uuid for each scan result to the a list
const result = await driver.execute('mobile:axeScan', axeSettings);
const uuid = result.axeResultKey["uuid"];
uuidList.push(uuid);
// Run this logic to print the URL after all tests complete.
const dashboardBaseUrl = "https://axe-mobile.deque.com";
const uuidString = uuidList.join(',');
const url = new URL('/scans', dashboardBaseUrl);
url.searchParams.append('uuids', uuidString);
console.info(`View scan group here: ${url.toString()}.`);