@guidepup/playwright 0.5.0 → 0.6.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 +8 -8
- package/lib/voTest.d.ts +1 -2
- package/lib/voTest.js +4 -5
- package/package.json +2 -2
- package/yarn.lock +4 -4
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ import { expect } from "@playwright/test";
|
|
|
28
28
|
test.describe("Playwright VoiceOver", () => {
|
|
29
29
|
test("I can navigate the Playwright website using VoiceOver", async ({
|
|
30
30
|
page,
|
|
31
|
-
|
|
31
|
+
voiceOver,
|
|
32
32
|
}) => {
|
|
33
33
|
// Navigate to Playwright website 🎉
|
|
34
34
|
await page.goto("https://playwright.dev/", {
|
|
@@ -36,18 +36,18 @@ test.describe("Playwright VoiceOver", () => {
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
// Interact with the page 🙌
|
|
39
|
-
await
|
|
39
|
+
await voiceOver.interact();
|
|
40
40
|
|
|
41
41
|
// Move across the navigation menu to the search bar using VoiceOver 🔎
|
|
42
|
-
while (!(await
|
|
43
|
-
await
|
|
42
|
+
while (!(await voiceOver.lastSpokenPhrase())?.startsWith("Search")) {
|
|
43
|
+
await voiceOver.next();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// Search for Safari 👀
|
|
47
|
-
await
|
|
48
|
-
await
|
|
49
|
-
await
|
|
50
|
-
await Promise.all([page.waitForNavigation(),
|
|
47
|
+
await voiceOver.type("Safari");
|
|
48
|
+
await voiceOver.press("ArrowDown");
|
|
49
|
+
await voiceOver.press("ArrowUp");
|
|
50
|
+
await Promise.all([page.waitForNavigation(), voiceOver.act()]);
|
|
51
51
|
expect(page.url()).toBe("https://playwright.dev/docs/browsers#webkit");
|
|
52
52
|
});
|
|
53
53
|
});
|
package/lib/voTest.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { VoiceOver } from "@guidepup/guidepup";
|
|
2
1
|
/**
|
|
3
2
|
* These tests extend the default Playwright environment that launches the
|
|
4
3
|
* browser with a running instance of the VoiceOver screen-reader for MacOS.
|
|
@@ -6,6 +5,6 @@ import { VoiceOver } from "@guidepup/guidepup";
|
|
|
6
5
|
* A fresh started VoiceOver instance `vo` is provided to each test.
|
|
7
6
|
*/
|
|
8
7
|
declare const voTest: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
|
|
9
|
-
|
|
8
|
+
voiceOver: any;
|
|
10
9
|
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
11
10
|
export { voTest };
|
package/lib/voTest.js
CHANGED
|
@@ -12,15 +12,14 @@ const PLAYWRIGHT_APPLICATION = "Playwright";
|
|
|
12
12
|
* A fresh started VoiceOver instance `vo` is provided to each test.
|
|
13
13
|
*/
|
|
14
14
|
const voTest = test_1.test.extend({
|
|
15
|
-
|
|
16
|
-
const vo = new guidepup_1.VoiceOver();
|
|
15
|
+
voiceOver: async ({}, use) => {
|
|
17
16
|
try {
|
|
18
|
-
await
|
|
17
|
+
await guidepup_1.voiceOver.start();
|
|
19
18
|
await (0, guidepup_1.macOSActivate)(PLAYWRIGHT_APPLICATION);
|
|
20
|
-
await use(
|
|
19
|
+
await use(guidepup_1.voiceOver);
|
|
21
20
|
}
|
|
22
21
|
finally {
|
|
23
|
-
await
|
|
22
|
+
await guidepup_1.voiceOver.stop();
|
|
24
23
|
}
|
|
25
24
|
},
|
|
26
25
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guidepup/playwright",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Screen-reader driver for Playwright.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prepublish": "yarn build"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@guidepup/guidepup": "^0.
|
|
34
|
+
"@guidepup/guidepup": "^0.13.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@playwright/test": "^1.17.1",
|
package/yarn.lock
CHANGED
|
@@ -456,10 +456,10 @@
|
|
|
456
456
|
minimatch "^3.0.4"
|
|
457
457
|
strip-json-comments "^3.1.1"
|
|
458
458
|
|
|
459
|
-
"@guidepup/guidepup@^0.
|
|
460
|
-
version "0.
|
|
461
|
-
resolved "https://registry.yarnpkg.com/@guidepup/guidepup/-/guidepup-0.
|
|
462
|
-
integrity sha512-
|
|
459
|
+
"@guidepup/guidepup@^0.13.0":
|
|
460
|
+
version "0.13.0"
|
|
461
|
+
resolved "https://registry.yarnpkg.com/@guidepup/guidepup/-/guidepup-0.13.0.tgz#7995ec599283d02a9532c9f79aca2ca3aa2e3c47"
|
|
462
|
+
integrity sha512-U56KXtxkyZa9m7q9l4et3AtkU+0Z+cYEnF4vA5ZgUbJCfQr66F2Rn04HPhIDDEZ/2PMYP5NsdDONSWu23ESQ4w==
|
|
463
463
|
|
|
464
464
|
"@humanwhocodes/config-array@^0.9.2":
|
|
465
465
|
version "0.9.2"
|