@guidepup/playwright 0.13.1 → 0.14.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/README.md +20 -2
- package/lib/nvdaTest.d.ts +12 -1
- package/lib/nvdaTest.js +3 -2
- package/lib/voiceOverTest.d.ts +7 -1
- package/lib/voiceOverTest.js +3 -2
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
## [Documentation](https://guidepup.dev) | [API Reference](https://www.guidepup.dev/docs/api/class-guidepup)
|
|
8
8
|
|
|
9
|
-
[](https://apps.apple.com/id/app/macos-big-sur/id1526878132)
|
|
10
9
|
[](https://apps.apple.com/us/app/macos-monterey/id1576738294)
|
|
11
10
|
[](https://apps.apple.com/us/app/macos-ventura/id1638787999)
|
|
11
|
+
[](https://apps.apple.com/us/app/macos-sonoma/id6450717509)
|
|
12
12
|
[](https://www.microsoft.com/en-gb/software-download/windows10ISO)
|
|
13
13
|
[](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019)
|
|
14
14
|
[](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2022)
|
|
@@ -109,12 +109,30 @@ await nvda.navigateToWebContent();
|
|
|
109
109
|
|
|
110
110
|
// ... some commands
|
|
111
111
|
|
|
112
|
-
// Collect all spoken
|
|
112
|
+
// Collect all spoken phrases
|
|
113
113
|
const allSpokenPhrases = [...spokenPhrases, ...(await nvda.spokenPhraseLog())];
|
|
114
114
|
|
|
115
115
|
// ... do something with spoken phrases
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
+
### Providing Screen Reader Start Options
|
|
119
|
+
|
|
120
|
+
The options provided to `nvda.start([options])` or `voiceOver.start([options])` can be configured using `test.use(config)` as follows:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
// VoiceOver Example
|
|
124
|
+
import { voiceOverTest as test } from "@guidepup/playwright";
|
|
125
|
+
|
|
126
|
+
test.use({ voiceOverStartOptions: { capture: "initial" } });
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
// NVDA Example
|
|
131
|
+
import { nvdaTest as test } from "@guidepup/playwright";
|
|
132
|
+
|
|
133
|
+
test.use({ nvdaStartOptions: { capture: "initial" } });
|
|
134
|
+
```
|
|
135
|
+
|
|
118
136
|
### VoiceOver Example
|
|
119
137
|
|
|
120
138
|
`playwright.config.ts`:
|
package/lib/nvdaTest.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { NVDA } from "@guidepup/guidepup";
|
|
1
|
+
import type { CommandOptions, NVDA } from "@guidepup/guidepup";
|
|
2
|
+
type Prettify<T> = {
|
|
3
|
+
[K in keyof T]: T[K];
|
|
4
|
+
} & {};
|
|
5
|
+
type CaptureCommandOptions = Prettify<Pick<CommandOptions, "capture">>;
|
|
2
6
|
/**
|
|
3
7
|
* [API Reference](https://www.guidepup.dev/docs/api/class-nvda)
|
|
4
8
|
*
|
|
@@ -62,4 +66,11 @@ export declare const nvdaTest: import("@playwright/test").TestType<import("@play
|
|
|
62
66
|
* ```
|
|
63
67
|
*/
|
|
64
68
|
nvda: NVDAPlaywright;
|
|
69
|
+
/**
|
|
70
|
+
* [API Reference](https://www.guidepup.dev/docs/api/class-command-options)
|
|
71
|
+
*
|
|
72
|
+
* Options to start NVDA with, see also [nvda.start([options])](https://www.guidepup.dev/docs/api/class-nvda#nvda-start).
|
|
73
|
+
*/
|
|
74
|
+
nvdaStartOptions: CaptureCommandOptions;
|
|
65
75
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
76
|
+
export {};
|
package/lib/nvdaTest.js
CHANGED
|
@@ -38,7 +38,8 @@ const focusBrowser = async ({ applicationName, }) => {
|
|
|
38
38
|
* A fresh started NVDA instance `nvda` is provided to each test.
|
|
39
39
|
*/
|
|
40
40
|
exports.nvdaTest = test_1.test.extend({
|
|
41
|
-
|
|
41
|
+
nvdaStartOptions: {},
|
|
42
|
+
nvda: async ({ browserName, page, nvdaStartOptions }, use) => {
|
|
42
43
|
try {
|
|
43
44
|
const applicationName = applicationNameMap_1.applicationNameMap[browserName];
|
|
44
45
|
if (!applicationName) {
|
|
@@ -70,7 +71,7 @@ exports.nvdaTest = test_1.test.extend({
|
|
|
70
71
|
await nvdaPlaywright.clearItemTextLog();
|
|
71
72
|
await nvdaPlaywright.clearSpokenPhraseLog();
|
|
72
73
|
};
|
|
73
|
-
await nvdaPlaywright.start();
|
|
74
|
+
await nvdaPlaywright.start(nvdaStartOptions);
|
|
74
75
|
await use(nvdaPlaywright);
|
|
75
76
|
}
|
|
76
77
|
finally {
|
package/lib/voiceOverTest.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VoiceOver } from "@guidepup/guidepup";
|
|
1
|
+
import type { CommandOptions, VoiceOver } from "@guidepup/guidepup";
|
|
2
2
|
/**
|
|
3
3
|
* [API Reference](https://www.guidepup.dev/docs/api/class-voiceover)
|
|
4
4
|
*
|
|
@@ -66,4 +66,10 @@ export declare const voiceOverTest: import("@playwright/test").TestType<import("
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
voiceOver: VoiceOverPlaywright;
|
|
69
|
+
/**
|
|
70
|
+
* [API Reference](https://www.guidepup.dev/docs/api/class-command-options)
|
|
71
|
+
*
|
|
72
|
+
* Options to start VoiceOver with, see also [voiceOver.start([options])](https://www.guidepup.dev/docs/api/class-voiceover#voiceover-start).
|
|
73
|
+
*/
|
|
74
|
+
voiceOverStartOptions: CommandOptions;
|
|
69
75
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
package/lib/voiceOverTest.js
CHANGED
|
@@ -12,7 +12,8 @@ const voiceOverPlaywright = guidepup_1.voiceOver;
|
|
|
12
12
|
* A fresh started VoiceOver instance `voiceOver` is provided to each test.
|
|
13
13
|
*/
|
|
14
14
|
exports.voiceOverTest = test_1.test.extend({
|
|
15
|
-
|
|
15
|
+
voiceOverStartOptions: {},
|
|
16
|
+
voiceOver: async ({ browserName, page, voiceOverStartOptions }, use) => {
|
|
16
17
|
try {
|
|
17
18
|
const applicationName = applicationNameMap_1.applicationNameMap[browserName];
|
|
18
19
|
if (!applicationName) {
|
|
@@ -32,7 +33,7 @@ exports.voiceOverTest = test_1.test.extend({
|
|
|
32
33
|
await voiceOverPlaywright.clearItemTextLog();
|
|
33
34
|
await voiceOverPlaywright.clearSpokenPhraseLog();
|
|
34
35
|
};
|
|
35
|
-
await voiceOverPlaywright.start();
|
|
36
|
+
await voiceOverPlaywright.start(voiceOverStartOptions);
|
|
36
37
|
await (0, guidepup_1.macOSActivate)(applicationName);
|
|
37
38
|
await use(voiceOverPlaywright);
|
|
38
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guidepup/playwright",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Screen reader driver for Playwright tests.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -16,10 +16,13 @@
|
|
|
16
16
|
"homepage": "https://github.com/guidepup/guidepup-playwright",
|
|
17
17
|
"keywords": [
|
|
18
18
|
"playwright",
|
|
19
|
+
"screen reader",
|
|
19
20
|
"screen-reader",
|
|
20
21
|
"accessibility",
|
|
21
22
|
"a11y",
|
|
22
|
-
"voiceover"
|
|
23
|
+
"voiceover",
|
|
24
|
+
"nvda",
|
|
25
|
+
"guidepup"
|
|
23
26
|
],
|
|
24
27
|
"scripts": {
|
|
25
28
|
"build": "yarn clean && yarn compile",
|
|
@@ -39,20 +42,20 @@
|
|
|
39
42
|
"test:voiceover:webkit": "playwright test --config ./examples/playwright-voiceover/webkit.config.ts ./examples/playwright-voiceover/tests/webkit/"
|
|
40
43
|
},
|
|
41
44
|
"devDependencies": {
|
|
42
|
-
"@guidepup/guidepup": "^0.22.
|
|
43
|
-
"@playwright/test": "^1.
|
|
44
|
-
"@types/node": "^20.
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
46
|
-
"@typescript-eslint/parser": "^6.
|
|
45
|
+
"@guidepup/guidepup": "^0.22.1",
|
|
46
|
+
"@playwright/test": "^1.41.1",
|
|
47
|
+
"@types/node": "^20.11.15",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
|
49
|
+
"@typescript-eslint/parser": "^6.20.0",
|
|
47
50
|
"eslint": "^8.56.0",
|
|
48
51
|
"eslint-config-prettier": "^9.1.0",
|
|
49
52
|
"rimraf": "^5.0.5",
|
|
50
53
|
"ts-node": "^10.9.2",
|
|
51
|
-
"typedoc": "^0.25.
|
|
54
|
+
"typedoc": "^0.25.7",
|
|
52
55
|
"typescript": "^5.3.3"
|
|
53
56
|
},
|
|
54
57
|
"peerDependencies": {
|
|
55
|
-
"@guidepup/guidepup": "^0.22.
|
|
58
|
+
"@guidepup/guidepup": "^0.22.1",
|
|
56
59
|
"@playwright/test": "^1.40.1"
|
|
57
60
|
},
|
|
58
61
|
"resolutions": {
|