@guidepup/playwright 0.13.2 → 0.14.1
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 +19 -3
- 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 +10 -9
package/README.md
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
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)
|
|
12
11
|
[](https://apps.apple.com/us/app/macos-sonoma/id6450717509)
|
|
@@ -20,7 +19,6 @@ This package provides [Guidepup](https://github.com/guidepup/guidepup) integrati
|
|
|
20
19
|
|
|
21
20
|
- **Full Control** - If a screen reader has a keyboard command, then Guidepup supports it.
|
|
22
21
|
- **Mirrors Real User Experience** - Assert on what users really do and hear when using screen readers.
|
|
23
|
-
- **Framework Agnostic** - Run with Jest, with Playwright, as an independent script, no vendor lock-in.
|
|
24
22
|
|
|
25
23
|
## Getting Started
|
|
26
24
|
|
|
@@ -110,12 +108,30 @@ await nvda.navigateToWebContent();
|
|
|
110
108
|
|
|
111
109
|
// ... some commands
|
|
112
110
|
|
|
113
|
-
// Collect all spoken
|
|
111
|
+
// Collect all spoken phrases
|
|
114
112
|
const allSpokenPhrases = [...spokenPhrases, ...(await nvda.spokenPhraseLog())];
|
|
115
113
|
|
|
116
114
|
// ... do something with spoken phrases
|
|
117
115
|
```
|
|
118
116
|
|
|
117
|
+
### Providing Screen Reader Start Options
|
|
118
|
+
|
|
119
|
+
The options provided to `nvda.start([options])` or `voiceOver.start([options])` can be configured using `test.use(config)` as follows:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
// VoiceOver Example
|
|
123
|
+
import { voiceOverTest as test } from "@guidepup/playwright";
|
|
124
|
+
|
|
125
|
+
test.use({ voiceOverStartOptions: { capture: "initial" } });
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
// NVDA Example
|
|
130
|
+
import { nvdaTest as test } from "@guidepup/playwright";
|
|
131
|
+
|
|
132
|
+
test.use({ nvdaStartOptions: { capture: "initial" } });
|
|
133
|
+
```
|
|
134
|
+
|
|
119
135
|
### VoiceOver Example
|
|
120
136
|
|
|
121
137
|
`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.1",
|
|
4
4
|
"description": "Screen reader driver for Playwright tests.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -42,17 +42,18 @@
|
|
|
42
42
|
"test:voiceover:webkit": "playwright test --config ./examples/playwright-voiceover/webkit.config.ts ./examples/playwright-voiceover/tests/webkit/"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@guidepup/guidepup": "^0.
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@typescript-eslint/
|
|
45
|
+
"@guidepup/guidepup": "^0.24.0",
|
|
46
|
+
"@guidepup/record": "^0.1.0",
|
|
47
|
+
"@playwright/test": "^1.47.1",
|
|
48
|
+
"@types/node": "^22.5.5",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
|
50
|
+
"@typescript-eslint/parser": "^8.5.0",
|
|
50
51
|
"eslint": "^8.56.0",
|
|
51
52
|
"eslint-config-prettier": "^9.1.0",
|
|
52
|
-
"rimraf": "^
|
|
53
|
+
"rimraf": "^6.0.1",
|
|
53
54
|
"ts-node": "^10.9.2",
|
|
54
|
-
"typedoc": "^0.
|
|
55
|
-
"typescript": "^5.
|
|
55
|
+
"typedoc": "^0.26.7",
|
|
56
|
+
"typescript": "^5.6.2"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"@guidepup/guidepup": "^0.22.1",
|