Created
May 24, 2019 21:39
-
-
Save weienwong/5cbe821fedb7f4d6790517c9af6d5b7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(async () => { | |
const browser = await puppeteer.launch() | |
const page = await browser.newPage() | |
await page.setBypassCSP(true) | |
await page.goto("http://localhost:8000") | |
const results = await new AxePuppeteer(page) | |
.analyze() | |
if (results.violations.length > 0) { | |
log(chalk.red.bold("Axe violations:")) | |
for (let i = 0; i < results.violations.length; i++) { | |
console.log(results.violations[i]); | |
} | |
} else { | |
console.log("All accessibility tests have passed!"); | |
} | |
await page.close() | |
await browser.close() | |
server.close((err) => { | |
if (err) { | |
console.error(err); | |
} | |
}) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment