Usage: Running Level CI Static Page Analysis in Puppeteer
This example shows how to run a static accessibility analysis on a webpage using Level CI Puppeteer:
const puppeteer = require('puppeteer')
const { levelAnalyze } = require('@level-ci/a11y-puppeteer')
;(async () => {
const browser = await puppeteer.launch({ headless: false })
const page = await browser.newPage()
// Visit a target page
await page.goto('https://www.google.com')
// Run static accessibility analysis
await levelAnalyze(page)
await browser.close()
})()
You can customize its behavior by passing configuration options to levelAnalyze().
Last updated on