@atomicsmash/test-utils 5.0.7-beta.1 → 6.0.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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -13
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare const doLighthouseTest: (pageToTest: {
|
|
|
44
44
|
export declare function checkAccessibility(page: Page, { includes, excludes, }?: {
|
|
45
45
|
includes?: SerialFrameSelector[];
|
|
46
46
|
excludes?: SerialFrameSelector[];
|
|
47
|
-
}): Promise<
|
|
47
|
+
}): Promise<import("axe-core").Result[]>;
|
|
48
48
|
export declare const checkPrivilegedPages: (pagesToTest: PageList) => ({ page }: {
|
|
49
49
|
page: Page;
|
|
50
50
|
}) => Promise<void>;
|
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,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAWpD,MAAM,MAAM,iBAAiB,GAC1B,iBAAiB,GACjB,YAAY,GACZ,aAAa,GACb,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,aAAa,CAAC;AACjB,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,cAAc,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;AAC/D,MAAM,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,QAAQ,CAAC;CACh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,WAAW,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,2HAkDlE"}
|
package/dist/index.js
CHANGED
|
@@ -66,7 +66,6 @@ export const playwrightConfig = {
|
|
|
66
66
|
};
|
|
67
67
|
export const lighthouseTest = base.extend({
|
|
68
68
|
port: [
|
|
69
|
-
// eslint-disable-next-line no-empty-pattern -- destructure pattern is required by playwright
|
|
70
69
|
async ({}, use) => {
|
|
71
70
|
// Assign a unique port for each playwright worker to support parallel tests
|
|
72
71
|
const port = await getPort();
|
|
@@ -77,7 +76,7 @@ export const lighthouseTest = base.extend({
|
|
|
77
76
|
browser: [
|
|
78
77
|
async ({ port }, use) => {
|
|
79
78
|
const browser = await chromium.launch({
|
|
80
|
-
args: [`--remote-debugging-port=${port}`],
|
|
79
|
+
args: [`--remote-debugging-port=${port.toString()}`],
|
|
81
80
|
});
|
|
82
81
|
await use(browser);
|
|
83
82
|
},
|
|
@@ -124,7 +123,6 @@ export const doLighthouseTest = (pageToTest, type, disableAuditLogs = false) =>
|
|
|
124
123
|
};
|
|
125
124
|
export async function checkAccessibility(page, { includes, excludes, } = {}) {
|
|
126
125
|
let builder;
|
|
127
|
-
// TODO: Wait for @wordpress/scripts to update dependency constraint, then remove this "as" declaration.
|
|
128
126
|
builder = new AxeBuilder({ page });
|
|
129
127
|
if (includes) {
|
|
130
128
|
for (const include of includes) {
|
|
@@ -138,15 +136,7 @@ export async function checkAccessibility(page, { includes, excludes, } = {}) {
|
|
|
138
136
|
}
|
|
139
137
|
builder = builder.exclude("#userback_button_container"); // Ignore userback testing tool
|
|
140
138
|
const accessibilityScanResults = await builder.analyze();
|
|
141
|
-
|
|
142
|
-
if (violation.id === "aria-allowed-attr" &&
|
|
143
|
-
violation.nodes[0] &&
|
|
144
|
-
violation.nodes[0].html.startsWith("<button") &&
|
|
145
|
-
violation.nodes[0].html.includes(`role="switch"`)) {
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
return true;
|
|
149
|
-
})).toEqual([]);
|
|
139
|
+
return accessibilityScanResults.violations;
|
|
150
140
|
}
|
|
151
141
|
export const checkPrivilegedPages = (pagesToTest) => async ({ page }) => {
|
|
152
142
|
for (const pageToTest of pagesToTest) {
|
|
@@ -226,7 +216,7 @@ export function generateProjectsForAllBrowsers(baseProject) {
|
|
|
226
216
|
]) {
|
|
227
217
|
projects.push({
|
|
228
218
|
...baseProject,
|
|
229
|
-
name: `${baseProject.name}__${browser.name}`,
|
|
219
|
+
name: `${baseProject.name ?? "unknown_project"}__${browser.name}`,
|
|
230
220
|
use: { ...baseProject.use, ...browser.use },
|
|
231
221
|
grepInvert: [
|
|
232
222
|
...[baseProject.grepInvert].flat(1),
|