@web/test-runner-commands 1.0.1 → 1.0.3
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/a11ySnapshotPlugin.d.ts.map +1 -1
- package/dist/a11ySnapshotPlugin.js +7 -1
- package/dist/a11ySnapshotPlugin.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/a11ySnapshotPlugin.ts +13 -1
- package/src/index.ts +17 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11ySnapshotPlugin.d.ts","sourceRoot":"","sources":["../src/a11ySnapshotPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,MAAM,mBAAmB,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,wBAAgB,kBAAkB,IAAI,gBAAgB,CAAC,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"a11ySnapshotPlugin.d.ts","sourceRoot":"","sources":["../src/a11ySnapshotPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,MAAM,mBAAmB,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,wBAAgB,kBAAkB,IAAI,gBAAgB,CAAC,mBAAmB,CAAC,CA0D1E"}
|
|
@@ -9,6 +9,12 @@ function a11ySnapshotPlugin() {
|
|
|
9
9
|
// handle specific behavior for playwright
|
|
10
10
|
if (session.browser.type === 'playwright') {
|
|
11
11
|
const page = session.browser.getPage(session.id);
|
|
12
|
+
// Playwright 1.57 removed page.accessibility
|
|
13
|
+
const { accessibility } = page;
|
|
14
|
+
if (!accessibility) {
|
|
15
|
+
throw new Error('Accessibility snapshot is not supported for Playwright 1.57 and later. ' +
|
|
16
|
+
'Use Playwright 1.56 or earlier, or the Chrome or Puppeteer launcher.');
|
|
17
|
+
}
|
|
12
18
|
const options = {};
|
|
13
19
|
if (payload && payload.selector) {
|
|
14
20
|
const root = await page.$(payload.selector);
|
|
@@ -16,7 +22,7 @@ function a11ySnapshotPlugin() {
|
|
|
16
22
|
options.root = root;
|
|
17
23
|
}
|
|
18
24
|
}
|
|
19
|
-
const snapshot = await
|
|
25
|
+
const snapshot = await accessibility.snapshot(options);
|
|
20
26
|
return snapshot;
|
|
21
27
|
}
|
|
22
28
|
// handle specific behavior for puppeteer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11ySnapshotPlugin.js","sourceRoot":"","sources":["../src/a11ySnapshotPlugin.ts"],"names":[],"mappings":";;AAMA,
|
|
1
|
+
{"version":3,"file":"a11ySnapshotPlugin.js","sourceRoot":"","sources":["../src/a11ySnapshotPlugin.ts"],"names":[],"mappings":";;AAMA,gDA0DC;AA1DD,SAAgB,kBAAkB;IAChC,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,KAAK,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;YAChD,IAAI,OAAO,KAAK,eAAe,EAAE,CAAC;gBAChC,0CAA0C;gBAC1C,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;oBAC1C,MAAM,IAAI,GAAI,OAAO,CAAC,OAA8B,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;oBACzE,6CAA6C;oBAC7C,MAAM,EAAE,aAAa,EAAE,GAAG,IAIzB,CAAC;oBACF,IAAI,CAAC,aAAa,EAAE,CAAC;wBACnB,MAAM,IAAI,KAAK,CACb,yEAAyE;4BACvE,sEAAsE,CACzE,CAAC;oBACJ,CAAC;oBACD,MAAM,OAAO,GAET,EAAE,CAAC;oBACP,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;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|
1
|
+
export { a11ySnapshotPlugin, type A11ySnapshotPayload } from './a11ySnapshotPlugin.js';
|
|
2
|
+
export { emulateMediaPlugin, type Media } from './emulateMediaPlugin.js';
|
|
3
|
+
export { filePlugin, type ReadFilePayload, type RemoveFilePayload, type WriteFilePayload, } from './filePlugin.js';
|
|
4
|
+
export { selectOptionPlugin, type SelectOptionPayload } from './selectOptionPlugin.js';
|
|
5
|
+
export { sendKeysPlugin, type SendKeysPayload } from './sendKeysPlugin.js';
|
|
6
|
+
export { sendMousePlugin, type SendMousePayload } from './sendMousePlugin.js';
|
|
7
7
|
export { setUserAgentPlugin } from './setUserAgentPlugin.js';
|
|
8
|
-
export {
|
|
9
|
-
export { SaveSnapshotPayload, SnapshotPluginConfig,
|
|
8
|
+
export { setViewportPlugin, type Viewport } from './setViewportPlugin.js';
|
|
9
|
+
export { snapshotPlugin, type SaveSnapshotPayload, type SnapshotPluginConfig, } from './snapshotPlugin.js';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
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,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuF;AAA9E,2HAAA,kBAAkB,OAAA;AAC3B,iEAAyE;AAAhE,2HAAA,kBAAkB,OAAA;AAC3B,iDAKyB;AAJvB,2GAAA,UAAU,OAAA;AAKZ,iEAAuF;AAA9E,2HAAA,kBAAkB,OAAA;AAC3B,yDAA2E;AAAlE,mHAAA,cAAc,OAAA;AACvB,2DAA8E;AAArE,qHAAA,eAAe,OAAA;AACxB,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,+DAA0E;AAAjE,yHAAA,iBAAiB,OAAA;AAC1B,yDAI6B;AAH3B,mHAAA,cAAc,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web/test-runner-commands",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"commands"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@web/test-runner-core": "^1.0.
|
|
52
|
+
"@web/test-runner-core": "^1.0.2",
|
|
53
53
|
"mkdirp": "^1.0.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@web/test-runner-chrome": "^1.0.
|
|
57
|
-
"@web/test-runner-playwright": "^1.0.
|
|
58
|
-
"@web/test-runner-webdriver": "^1.0.
|
|
59
|
-
"
|
|
56
|
+
"@web/test-runner-chrome": "^1.0.2",
|
|
57
|
+
"@web/test-runner-playwright": "^1.0.2",
|
|
58
|
+
"@web/test-runner-webdriver": "^1.0.1",
|
|
59
|
+
"chai": "^6.0.0"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -12,6 +12,18 @@ export function a11ySnapshotPlugin(): TestRunnerPlugin<A11ySnapshotPayload> {
|
|
|
12
12
|
// handle specific behavior for playwright
|
|
13
13
|
if (session.browser.type === 'playwright') {
|
|
14
14
|
const page = (session.browser as PlaywrightLauncher).getPage(session.id);
|
|
15
|
+
// Playwright 1.57 removed page.accessibility
|
|
16
|
+
const { accessibility } = page as playwright.Page & {
|
|
17
|
+
accessibility?: {
|
|
18
|
+
snapshot(options: { root?: playwright.ElementHandle }): Promise<unknown>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
if (!accessibility) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
'Accessibility snapshot is not supported for Playwright 1.57 and later. ' +
|
|
24
|
+
'Use Playwright 1.56 or earlier, or the Chrome or Puppeteer launcher.',
|
|
25
|
+
);
|
|
26
|
+
}
|
|
15
27
|
const options: {
|
|
16
28
|
root?: playwright.ElementHandle;
|
|
17
29
|
} = {};
|
|
@@ -21,7 +33,7 @@ export function a11ySnapshotPlugin(): TestRunnerPlugin<A11ySnapshotPayload> {
|
|
|
21
33
|
options.root = root;
|
|
22
34
|
}
|
|
23
35
|
}
|
|
24
|
-
const snapshot = await
|
|
36
|
+
const snapshot = await accessibility.snapshot(options);
|
|
25
37
|
return snapshot;
|
|
26
38
|
}
|
|
27
39
|
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export { a11ySnapshotPlugin, type A11ySnapshotPayload } from './a11ySnapshotPlugin.js';
|
|
2
|
+
export { emulateMediaPlugin, type Media } from './emulateMediaPlugin.js';
|
|
3
|
+
export {
|
|
4
|
+
filePlugin,
|
|
5
|
+
type ReadFilePayload,
|
|
6
|
+
type RemoveFilePayload,
|
|
7
|
+
type WriteFilePayload,
|
|
8
|
+
} from './filePlugin.js';
|
|
9
|
+
export { selectOptionPlugin, type SelectOptionPayload } from './selectOptionPlugin.js';
|
|
10
|
+
export { sendKeysPlugin, type SendKeysPayload } from './sendKeysPlugin.js';
|
|
11
|
+
export { sendMousePlugin, type SendMousePayload } from './sendMousePlugin.js';
|
|
7
12
|
export { setUserAgentPlugin } from './setUserAgentPlugin.js';
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
13
|
+
export { setViewportPlugin, type Viewport } from './setViewportPlugin.js';
|
|
14
|
+
export {
|
|
15
|
+
snapshotPlugin,
|
|
16
|
+
type SaveSnapshotPayload,
|
|
17
|
+
type SnapshotPluginConfig,
|
|
18
|
+
} from './snapshotPlugin.js';
|