-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy patha11y.lighthouse.spec.ts
33 lines (30 loc) · 965 Bytes
/
a11y.lighthouse.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { playAudit } from 'playwright-lighthouse';
import { test } from '@playwright/test';
import playwright from 'playwright';
test('Accessibility test', async ({ browserName }) => {
test.skip(browserName !== 'chromium', 'Still working on it');
const browser = await playwright['chromium'].launch({
args: ['--remote-debugging-port=9222'],
});
const page = await browser.newPage();
await page.goto('https://www.washington.edu/accesscomputing/AU/before.html');
await playAudit({
page: page,
thresholds: {
performance: 50,
accessibility: 50,
'best-practices': 50,
seo: 50,
pwa: 0,
},
port: 9222,
reports: {
formats: {
json: true, //defaults to false
html: true, //defaults to false
csv: true, //defaults to false
}
},
});
await browser.close();
});