Reporting

Siteimprove Intelligence Platform

Users of the Siteimprove Intelligence Platform can upload audit results and view them in the Page Report. You first need to create an API key in the Siteimprove Intelligence Platform.

Then, simply use the SIP.upload function on the audit result, providing the Siteimprove Intelligence Platform credentials. Here, the credentials are passed as environment variables. Depending on setup it might be more convenient to use CI/CD secrets; it is not advised to hard-code the credentials in the code as these should be treated as any password.

import { Audit, SIP, Logging } from "@siteimprove/alfa-test-utils";

// ... code for generating alfaResult ...

// Upload the received accessibility audit result to the Siteimprove Intelligence Platform
const pageReportURL = await SIP.upload(alfaResult, {
  userName: process.env.SI_USER_NAME, // Email address of the user.
  apiKey: process.env.SI_API_KEY, // API key generated in the platform.
  testName: (git) => git.BranchName // Use the git branch name as test name
});

// Print the result and the Page Report link to the console
Logging.fromAudit(alfaResult, pageReportURL).print();

This returns a URL to a Siteimprove Intelligence Platform Page Report showing the audit results.

Note: By default, running this from a git repository will upload basic git information. To disable this, set the includeGitInfo: false option in the second argument of SIP.upload.

Note: If no credentials are provided, this will simply log a summary of the audit in the console.

Previous: UsageNext: Configuration