Skip to content

Audit from alfa-act & input directly from Puppeteer - possible? #736

Discussion options

You must be logged in to vote

Hi there! You can absolutely do that, yes:

import { Puppeteer } from "@siteimprove/alfa-puppeteer";

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');

const handle = await page.evaluateHandle(() => window.document);

const outcomes = await Audit.of(await Puppeteer.toPage(handle), rules).evaluate();
  
await browser.close();

In fact, the Puppeteer example you linked does effectively the same thing right here: https://github.com/Siteimprove/alfa-examples/blob/ead4b79932f33135df718ef20d43e0e0f69203af/end-to-end-testing/puppeteer/test/page.spec.ts#L15

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@kasperisager
Comment options

@BogdanCerovac
Comment options

@kasperisager
Comment options

@BogdanCerovac
Comment options

@kasperisager
Comment options

Answer selected by BogdanCerovac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants