@guidepup/playwright 0.13.2 → 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 +19 -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 +1 -1
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)
|
|
@@ -110,12 +109,30 @@ await nvda.navigateToWebContent();
|
|
|
110
109
|
|
|
111
110
|
// ... some commands
|
|
112
111
|
|
|
113
|
-
// Collect all spoken
|
|
112
|
+
// Collect all spoken phrases
|
|
114
113
|
const allSpokenPhrases = [...spokenPhrases, ...(await nvda.spokenPhraseLog())];
|
|
115
114
|
|
|
116
115
|
// ... do something with spoken phrases
|
|
117
116
|
```
|
|
118
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
|
+
|
|
119
136
|
### VoiceOver Example
|
|
120
137
|
|
|
121
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
|
}
|