forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use the axe core playwright package
- Loading branch information
1 parent
18d58d4
commit 44d0cd1
Showing
3 changed files
with
32 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { injectAxe, checkA11y } from 'axe-playwright' | ||
import { test } from './fixtures' | ||
import { createRandomPage } from './utils' | ||
import { expect } from '@playwright/test' | ||
import AxeBuilder from '@axe-core/playwright' | ||
|
||
|
||
test('check a11y for the whole page', async ({ page }) => { | ||
await page.waitForTimeout(2000) // wait for everything be ready | ||
await injectAxe(page) | ||
await page.waitForTimeout(2000) // wait for everything be ready | ||
test('should not have any automatically detectable accessibility issues', async ({ page }) => { | ||
await createRandomPage(page) | ||
await page.waitForTimeout(2000) // wait for everything be ready | ||
await checkA11y(page, null, { | ||
detailedReport: true, | ||
}) | ||
await page.waitForTimeout(2000) | ||
const accessibilityScanResults = await new AxeBuilder({ page }) | ||
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']) | ||
.setLegacyMode() | ||
.analyze() | ||
|
||
expect(accessibilityScanResults.violations).toEqual([]); | ||
}) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,14 @@ | |
dependencies: | ||
"@jridgewell/trace-mapping" "^0.3.0" | ||
|
||
"@axe-core/playwright@^4.4.4": | ||
version "4.4.4" | ||
resolved "https://registry.yarnpkg.com/@axe-core/playwright/-/playwright-4.4.4.tgz#3786c5f6bba38d1991b608584b00ae2744544573" | ||
integrity sha512-VA7MR1WCqW5tFcUGCXDaaqV9pJUCdOGIR4DiZJrOxGjeRYxz3VwyMc1MDg/yiJ5fQA/QYMx+w0mvqYEr3CPx7w== | ||
dependencies: | ||
axe-core "^4.4.2" | ||
playwright ">= 1.0.0" | ||
|
||
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7": | ||
version "7.16.7" | ||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" | ||
|
@@ -1226,18 +1234,11 @@ autoprefixer@^9.8.6: | |
postcss "^7.0.32" | ||
postcss-value-parser "^4.1.0" | ||
|
||
axe-core@^4.0.1: | ||
axe-core@^4.4.2: | ||
version "4.4.3" | ||
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.3.tgz#11c74d23d5013c0fa5d183796729bc3482bd2f6f" | ||
integrity sha512-32+ub6kkdhhWick/UjvEwRchgoetXqTK14INLqbGm5U2TzBkBNF3nQtLYm8ovxSkQWArjEQvftCKryjZaATu3w== | ||
|
||
axe-playwright@^1.1.11: | ||
version "1.1.11" | ||
resolved "https://registry.yarnpkg.com/axe-playwright/-/axe-playwright-1.1.11.tgz#e57638f08d29b58d157a2aeb34cf81730eab2cff" | ||
integrity sha512-YHmUouvF/dFNxoFFwbCjPFmEPwoJSzPgZsD0KZs3xjsR03Rf2mAh771ugre950MaBYuiyxYDlurH5BOEJBK34Q== | ||
dependencies: | ||
axe-core "^4.0.1" | ||
|
||
bach@^1.0.0: | ||
version "1.2.0" | ||
resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" | ||
|
@@ -5560,6 +5561,18 @@ [email protected]: | |
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.24.2.tgz#47bc5adf3dcfcc297a5a7a332449c9009987db26" | ||
integrity sha512-zfAoDoPY/0sDLsgSgLZwWmSCevIg1ym7CppBwllguVBNiHeixZkc1AdMuYUPZC6AdEYc4CxWEyLMBTw2YcmRrA== | ||
|
||
[email protected]: | ||
version "1.25.2" | ||
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.25.2.tgz#ea4baa398a4d45fcdfe48799482b599e3d0f033f" | ||
integrity sha512-0yTbUE9lIddkEpLHL3u8PoCL+pWiZtj5A/j3U7YoNjcmKKDGBnCrgHJMzwd2J5vy6l28q4ki3JIuz7McLHhl1A== | ||
|
||
"playwright@>= 1.0.0": | ||
version "1.25.2" | ||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.25.2.tgz#0fc67e4385a52a51371ff9114bf68e3ad50a7f41" | ||
integrity sha512-RwMB5SFRV/8wSfK+tK8ycpqdzORvoqUNz9DUeRfSgZFrZej5uuBl9wFjWcc+OkXFEtaPmx1acAVGG7hA4IJ1kg== | ||
dependencies: | ||
playwright-core "1.25.2" | ||
|
||
playwright@^1.24.2: | ||
version "1.24.2" | ||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.24.2.tgz#51e60f128b386023e5ee83deca23453aaf73ba6d" | ||
|