@atomicsmash/test-utils 1.2.1 → 1.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/package.json +3 -4
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,IAAI,EACJ,cAAc,EACd,oBAAoB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAapD,MAAM,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B,EAAE,CAAC;AAEJ,MAAM,MAAM,wBAAwB,GAAG,CACtC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,EACxB,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,KAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,eAAO,MAAM,wBAAwB,EAAE,oBAAoB,CAAC,UAAU,CA2BrE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAoBG,CAAC;AAEjC,eAAO,MAAM,iBAAiB,cAAe,wBAAwB;uBAE9C,IAAI;aAAW,cAAc;;UAC1C,MAAM;EA2Bf,CAAC;AAEF,KAAK,sBAAsB,GAAG,UAAU,CACvC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CACpC,CAAC,CAAC,CAAC,CAAC;AAEL,eAAO,MAAM,gBAAgB,EAAE,CAC9B,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EA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C,QAAQ,EACR,QAAQ,GACR,GAAE;IACF,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC5B,iBAiCN;AAED,eAAO,MAAM,oBAAoB;UAEP,IAAI;mBAS5B,CAAC;AACH,eAAO,MAAM,kBAAkB;uBAEqB,IAAI;mBAStD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -86,6 +86,7 @@ export const getLighthouseTest = (logInUser) => {
|
|
|
86
86
|
export const doLighthouseTest = (pageToTest, type, disableAuditLogs = false) => async function ({ port, authenticatedPage }) {
|
|
87
87
|
await authenticatedPage.goto(pageToTest.url);
|
|
88
88
|
await playAudit({
|
|
89
|
+
// TODO: Wait for playwright-lighthouse to update dependency constraint, then remove this "as" declaration.
|
|
89
90
|
page: authenticatedPage,
|
|
90
91
|
thresholds: {
|
|
91
92
|
performance: 85,
|
|
@@ -111,6 +112,7 @@ export const doLighthouseTest = (pageToTest, type, disableAuditLogs = false) =>
|
|
|
111
112
|
};
|
|
112
113
|
export async function checkAccessibility(page, { includes, excludes, } = {}) {
|
|
113
114
|
let builder;
|
|
115
|
+
// TODO: Wait for @wordpress/scripts to update dependency constraint, then remove this "as" declaration.
|
|
114
116
|
builder = new AxeBuilder({ page });
|
|
115
117
|
if (includes) {
|
|
116
118
|
for (const include of includes) {
|
|
@@ -126,6 +128,7 @@ export async function checkAccessibility(page, { includes, excludes, } = {}) {
|
|
|
126
128
|
const accessibilityScanResults = await builder.analyze();
|
|
127
129
|
expect(accessibilityScanResults.violations.filter((violation) => {
|
|
128
130
|
if (violation.id === "aria-allowed-attr" &&
|
|
131
|
+
violation.nodes[0] &&
|
|
129
132
|
violation.nodes[0].html.startsWith("<button") &&
|
|
130
133
|
violation.nodes[0].html.includes(`role="switch"`)) {
|
|
131
134
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomicsmash/test-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A collection of helper functions for automated testing with Playwright.",
|
|
6
6
|
"keywords": [
|
|
@@ -46,9 +46,8 @@
|
|
|
46
46
|
"cross-env": "^7.0.3"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@axe-core/playwright": "^4.
|
|
49
|
+
"@axe-core/playwright": "^4.8.2",
|
|
50
50
|
"get-port": "^7.0.0",
|
|
51
|
-
"playwright-lighthouse": "^3.
|
|
52
|
-
"lighthouse": "^11.0.0"
|
|
51
|
+
"playwright-lighthouse": "^3.2.5"
|
|
53
52
|
}
|
|
54
53
|
}
|