Crea un URL per i risultati della scansione
Crea URL di scansione da AxeResultKey
Quando carichi la tua scansione, il risultato della scansione restituito dal driver contiene l'oggetto axeResultKey
. Questo oggetto ha tre proprietà: packageName
, userId
, resultId
e uuid
. Utilizzando le prime tre proprietà, è possibile creare l'URL che indirizza ai risultati caricati per una singola scansione sulla Dashboard mobile. Può essere utile per report personalizzati oppure se si desidera visualizzare il collegamento al risultato della scansione nei test. Utilizzare quanto segue come guida per la struttura dell'URL di scansione:
${dashboardHBaseURL}/scan?userId=${userId}&packageName=${packageName}&resultId=${resultId}
Il frammento seguente mostra come creare un URL per una singola scansione con 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()}.`);
Crea URL del gruppo di scansione da AxeResultKey
Come accennato in precedenza, AxeResultKey
ha quattro proprietà: packageName
, userId
, resultId
e uuid
. Utilizzando la proprietà uuid
, è possibile creare un URL che indirizzi a un gruppo di risultati di scansione (fino a 20) nella dashboard mobile. Utilizzare il seguente frammento JavaScript come guida per la struttura dell'URL di scansione:
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()}.`);