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 together with the siteID
the page belongs to. 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";
import { getCommitInformation } from "@siteimprove/alfa-test-utils/git";
// ... code for generating alfaResult ...
// Retrieve information about the latest (git) commit.
const gitInformation = await getCommitInformation();
// 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.
siteID: "12345", // The ID of the site in the Siteimprove Intelligence Platform.
commitInformation: gitInformation, // Basic information about the latest commit.
});
// 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.
Overview of options
See Configuring the Reports for more information about the reporting options.
userName
,apiKey
, andsiteID
are mandatory. If any is missing, the upload will fail and the function will return an error message.commitInformation
, with at least acommitInformation.BranchName
, is recommended as a way to separate tests run on different branches.pageTitle
andpageURL
are automatically filled with sensible values, but it can be convenient to overwrite them in certain scenarios.testName
is mostly cosmetic. It is displayed in the Page Report but not used otherwise.