@guidepup/playwright 0.7.4 → 0.8.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Craig Morten
3
+ Copyright (c) 2023 Craig Morten
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <h1 align="center">Guidepup Playwright</h1>
2
2
  <p align="center">
3
- <i>Screen-reader driver for Playwright.</i>
3
+ <i>Screen reader driver for Playwright tests.</i>
4
4
  </p>
5
5
  <p align="center">
6
6
  <a href="https://www.npmjs.com/package/@guidepup/playwright"><img alt="@guidepup/playwright available on NPM" src="https://img.shields.io/npm/v/@guidepup/playwright" /></a>
@@ -8,10 +8,10 @@
8
8
  <a href="https://github.com/guidepup/guidepup-playwright/blob/main/LICENSE"><img alt="@guidepup/playwright uses the MIT license" src="https://img.shields.io/github/license/guidepup/guidepup-playwright" /></a>
9
9
  </p>
10
10
  <p align="center">
11
- Providing a reliable set of APIs to automate your screen-reader a11y workflows in Playwright.
11
+ Providing a reliable set of APIs to automate your screen reader a11y workflows in Playwright.
12
12
  </p>
13
13
 
14
- ## Getting Started 🦮
14
+ ## Getting Started
15
15
 
16
16
  Install `@guidepup/playwright` to your project:
17
17
 
@@ -19,7 +19,7 @@ Install `@guidepup/playwright` to your project:
19
19
  npm install --save-dev @guidepup/playwright
20
20
  ```
21
21
 
22
- And get cracking with your first screen-reader tests in Playwright! 🚀
22
+ And get cracking with your first screen reader tests in Playwright!
23
23
 
24
24
  ```ts
25
25
  import { voTest as test } from "@guidepup/playwright";
@@ -30,26 +30,26 @@ test.describe("Playwright VoiceOver", () => {
30
30
  page,
31
31
  voiceOver,
32
32
  }) => {
33
- // Navigate to Guidepup GitHub page 🎉
33
+ // Navigate to Guidepup GitHub page
34
34
  await page.goto("https://github.com/guidepup/guidepup", {
35
35
  waitUntil: "domcontentloaded",
36
36
  });
37
37
 
38
- // Wait for page to be ready and interact 🙌
38
+ // Wait for page to be ready and interact
39
39
  await expect(page.locator('header[role="banner"]')).toBeVisible();
40
40
  await voiceOver.interact();
41
41
 
42
- // Move across the page menu to the Guidepup heading using VoiceOver 🔎
42
+ // Move across the page menu to the Guidepup heading using VoiceOver
43
43
  while ((await voiceOver.itemText()) !== "Guidepup heading level 1") {
44
44
  await voiceOver.perform(voiceOver.keyboard.commands.findNextHeading);
45
45
  }
46
46
  });
47
47
  ```
48
48
 
49
- ## Playwright Config 🐕‍🦺
49
+ ## Playwright Config
50
50
 
51
51
  In your `playwright.config.ts` add the following for the best results with
52
- Guidepup for VoiceOver automation. 💥
52
+ Guidepup for VoiceOver automation.
53
53
 
54
54
  ```ts
55
55
  import { devices, PlaywrightTestConfig } from "@playwright/test";
@@ -64,9 +64,9 @@ const config: PlaywrightTestConfig = {
64
64
  export default config;
65
65
  ```
66
66
 
67
- Check out the configuration this adds [in the voConfig.ts file](./src/voConfig.ts). 👀
67
+ Check out the configuration this adds [in the voConfig.ts file](./src/voConfig.ts).
68
68
 
69
- ## Environment Setup 🐾
69
+ ## Environment Setup
70
70
 
71
71
  Setup your environment for screen-read automation with [`@guidepup/setup`](https://github.com/guidepup/setup):
72
72
 
@@ -78,19 +78,19 @@ If you are using GitHub Actions, check out the dedicated [`guidepup/setup-action
78
78
 
79
79
  ```yaml
80
80
  - name: Setup Environment
81
- uses: guidepup/setup-action@0.4.0
81
+ uses: guidepup/setup-action@0.7.0
82
82
  ```
83
83
 
84
- ## Example 👀
84
+ ## Example
85
85
 
86
86
  Check out [this VoiceOver example](./example/).
87
87
 
88
- ## See Also 🐶
88
+ ## See Also
89
89
 
90
90
  Checkout the core [`@guidepup/guidepup`](https://github.com/guidepup/guidepup)
91
- project to learn more about how you can automate your screen-reader workflows
91
+ project to learn more about how you can automate your screen reader workflows
92
92
  using Guidepup.
93
93
 
94
- ## License 🐩
94
+ ## License
95
95
 
96
96
  [MIT](https://github.com/guidepup/guidepup/blob/main/LICENSE)
package/lib/voTest.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { voiceOver } from "@guidepup/guidepup";
2
2
  /**
3
3
  * These tests extend the default Playwright environment that launches the
4
- * browser with a running instance of the VoiceOver screen-reader for MacOS.
4
+ * browser with a running instance of the VoiceOver screen reader for MacOS.
5
5
  *
6
6
  * A fresh started VoiceOver instance `vo` is provided to each test.
7
7
  */
package/lib/voTest.js CHANGED
@@ -1,21 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.voTest = void 0;
4
- /* eslint-disable no-empty-pattern */
5
4
  const test_1 = require("@playwright/test");
6
5
  const guidepup_1 = require("@guidepup/guidepup");
7
- const PLAYWRIGHT_APPLICATION = "Playwright";
6
+ const applicationNameMap = {
7
+ chromium: "Chromium",
8
+ chrome: "Google Chrome",
9
+ "chrome-beta": "Google Chrome Beta",
10
+ msedge: "Microsoft Edge",
11
+ "msedge-beta": "Microsoft Edge Beta",
12
+ "msedge-dev": "Microsoft Edge Dev",
13
+ firefox: "Nightly",
14
+ webkit: "Playwright",
15
+ };
8
16
  /**
9
17
  * These tests extend the default Playwright environment that launches the
10
- * browser with a running instance of the VoiceOver screen-reader for MacOS.
18
+ * browser with a running instance of the VoiceOver screen reader for MacOS.
11
19
  *
12
20
  * A fresh started VoiceOver instance `vo` is provided to each test.
13
21
  */
14
22
  const voTest = test_1.test.extend({
15
- voiceOver: async ({}, use) => {
23
+ voiceOver: async ({ browserName }, use) => {
16
24
  try {
17
25
  await guidepup_1.voiceOver.start();
18
- await (0, guidepup_1.macOSActivate)(PLAYWRIGHT_APPLICATION);
26
+ await (0, guidepup_1.macOSActivate)(applicationNameMap[browserName]);
19
27
  await use(guidepup_1.voiceOver);
20
28
  }
21
29
  finally {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guidepup/playwright",
3
- "version": "0.7.4",
4
- "description": "Screen-reader driver for Playwright.",
3
+ "version": "0.8.0",
4
+ "description": "Screen reader driver for Playwright tests.",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "author": "Craig Morten <craig.morten@hotmail.co.uk>",
@@ -29,14 +29,14 @@
29
29
  "lint": "eslint . --ext .ts",
30
30
  "lint:fix": "yarn lint --fix",
31
31
  "prepublish": "yarn build",
32
- "pretest": "npx playwright install webkit",
33
- "test": "playwright test -c ./example/playwright.config.ts ./example/tests/playwright.spec.ts"
32
+ "pretest": "npx playwright install webkit chromium",
33
+ "test": "playwright test -c ./example/playwright.config.ts ./example/tests/"
34
34
  },
35
35
  "dependencies": {
36
- "@guidepup/guidepup": "^0.14.4"
36
+ "@guidepup/guidepup": "^0.15.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@playwright/test": "^1.25.1",
39
+ "@playwright/test": "^1.28.1",
40
40
  "@types/node": "^16.11.11",
41
41
  "@typescript-eslint/eslint-plugin": "^5.5.0",
42
42
  "@typescript-eslint/parser": "^5.5.0",
@@ -44,10 +44,10 @@
44
44
  "eslint-config-prettier": "^8.3.0",
45
45
  "rimraf": "^3.0.2",
46
46
  "ts-node": "^10.4.0",
47
- "typedoc": "^0.22.10",
47
+ "typedoc": "^0.23.21",
48
48
  "typescript": "^4.5.2"
49
49
  },
50
50
  "peerDependencies": {
51
- "@playwright/test": "^1.25.1"
51
+ "@playwright/test": "^1.28.1"
52
52
  }
53
53
  }
package/yarn.lock CHANGED
@@ -29,10 +29,10 @@
29
29
  minimatch "^3.0.4"
30
30
  strip-json-comments "^3.1.1"
31
31
 
32
- "@guidepup/guidepup@^0.14.4":
33
- version "0.14.4"
34
- resolved "https://registry.yarnpkg.com/@guidepup/guidepup/-/guidepup-0.14.4.tgz#9822597b042a9f1ca15eedeb10bb9badf94404c8"
35
- integrity sha512-ZYtiBc7JlN30aZphsREc6srVqjFraXcsfOObjVu2IFS/sEULFfRWB97pMpNOPH9UNAFWiRXQayuEV9LIxYzRfA==
32
+ "@guidepup/guidepup@^0.15.0":
33
+ version "0.15.0"
34
+ resolved "https://registry.yarnpkg.com/@guidepup/guidepup/-/guidepup-0.15.0.tgz#d9cd40f933f31c03d65f6bef9a31fee953654cc0"
35
+ integrity sha512-MUPtcp57e6Ehtgtn29nb1spObIz4dUA3aTj+FL4RGBGmv2q+YPXJ0zEKP2MP04QsTAJ5fL8vN2nddmnGGxSS+w==
36
36
 
37
37
  "@humanwhocodes/config-array@^0.9.2":
38
38
  version "0.9.2"
@@ -69,13 +69,13 @@
69
69
  "@nodelib/fs.scandir" "2.1.5"
70
70
  fastq "^1.6.0"
71
71
 
72
- "@playwright/test@^1.25.1":
73
- version "1.25.1"
74
- resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.25.1.tgz#9847234b6f2b0cca71962b338da7db366a1e9720"
75
- integrity sha512-IJ4X0yOakXtwkhbnNzKkaIgXe6df7u3H3FnuhI9Jqh+CdO0e/lYQlDLYiyI9cnXK8E7UAppAWP+VqAv6VX7HQg==
72
+ "@playwright/test@^1.28.1":
73
+ version "1.28.1"
74
+ resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.28.1.tgz#e5be297e024a3256610cac2baaa9347fd57c7860"
75
+ integrity sha512-xN6spdqrNlwSn9KabIhqfZR7IWjPpFK1835tFNgjrlysaSezuX8PYUwaz38V/yI8TJLG9PkAMEXoHRXYXlpTPQ==
76
76
  dependencies:
77
77
  "@types/node" "*"
78
- playwright-core "1.25.1"
78
+ playwright-core "1.28.1"
79
79
 
80
80
  "@tsconfig/node10@^1.0.7":
81
81
  version "1.0.8"
@@ -262,6 +262,13 @@ brace-expansion@^1.1.7:
262
262
  balanced-match "^1.0.0"
263
263
  concat-map "0.0.1"
264
264
 
265
+ brace-expansion@^2.0.1:
266
+ version "2.0.1"
267
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
268
+ integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
269
+ dependencies:
270
+ balanced-match "^1.0.0"
271
+
265
272
  braces@^3.0.1:
266
273
  version "3.0.2"
267
274
  resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
@@ -297,7 +304,7 @@ color-name@~1.1.4:
297
304
  concat-map@0.0.1:
298
305
  version "0.0.1"
299
306
  resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
300
- integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
307
+ integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
301
308
 
302
309
  create-require@^1.1.0:
303
310
  version "1.1.1"
@@ -560,7 +567,7 @@ glob-parent@^6.0.1:
560
567
  dependencies:
561
568
  is-glob "^4.0.3"
562
569
 
563
- glob@^7.1.3, glob@^7.2.0:
570
+ glob@^7.1.3:
564
571
  version "7.2.0"
565
572
  resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
566
573
  integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
@@ -706,10 +713,10 @@ make-error@^1.1.1:
706
713
  resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
707
714
  integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
708
715
 
709
- marked@^3.0.8:
710
- version "3.0.8"
711
- resolved "https://registry.yarnpkg.com/marked/-/marked-3.0.8.tgz#2785f0dc79cbdc6034be4bb4f0f0a396bd3f8aeb"
712
- integrity sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==
716
+ marked@^4.0.19:
717
+ version "4.2.3"
718
+ resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.3.tgz#bd76a5eb510ff1d8421bc6c3b2f0b93488c15bea"
719
+ integrity sha512-slWRdJkbTZ+PjkyJnE30Uid64eHwbwa1Q25INCAYfZlK4o6ylagBy/Le9eWntqJFoFT93ikUKMv47GZ4gTwHkw==
713
720
 
714
721
  merge2@^1.3.0, merge2@^1.4.1:
715
722
  version "1.4.1"
@@ -725,12 +732,19 @@ micromatch@^4.0.4:
725
732
  picomatch "^2.2.3"
726
733
 
727
734
  minimatch@^3.0.4:
728
- version "3.0.4"
729
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
730
- integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
735
+ version "3.1.2"
736
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
737
+ integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
731
738
  dependencies:
732
739
  brace-expansion "^1.1.7"
733
740
 
741
+ minimatch@^5.1.0:
742
+ version "5.1.1"
743
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.1.tgz#6c9dffcf9927ff2a31e74b5af11adf8b9604b022"
744
+ integrity sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==
745
+ dependencies:
746
+ brace-expansion "^2.0.1"
747
+
734
748
  ms@2.1.2:
735
749
  version "2.1.2"
736
750
  resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
@@ -787,10 +801,10 @@ picomatch@^2.2.3:
787
801
  resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
788
802
  integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
789
803
 
790
- playwright-core@1.25.1:
791
- version "1.25.1"
792
- resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.25.1.tgz#abe56aec8bef645fba988320d9f9328fafab0446"
793
- integrity sha512-lSvPCmA2n7LawD2Hw7gSCLScZ+vYRkhU8xH0AapMyzwN+ojoDqhkH/KIEUxwNu2PjPoE/fcE0wLAksdOhJ2O5g==
804
+ playwright-core@1.28.1:
805
+ version "1.28.1"
806
+ resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.28.1.tgz#8400be9f4a8d1c0489abdb9e75a4cc0ffc3c00cb"
807
+ integrity sha512-3PixLnGPno0E8rSBJjtwqTwJe3Yw72QwBBBxNoukIj3lEeBNXwbNiKrNuB1oyQgTBw5QHUhNO3SteEtHaMK6ag==
794
808
 
795
809
  prelude-ls@^1.2.1:
796
810
  version "1.2.1"
@@ -860,14 +874,14 @@ shebang-regex@^3.0.0:
860
874
  resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
861
875
  integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
862
876
 
863
- shiki@^0.9.12:
864
- version "0.9.15"
865
- resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.9.15.tgz#2481b46155364f236651319d2c18e329ead6fa44"
866
- integrity sha512-/Y0z9IzhJ8nD9nbceORCqu6NgT9X6I8Fk8c3SICHI5NbZRLdZYFaB233gwct9sU0vvSypyaL/qaKvzyQGJBZSw==
877
+ shiki@^0.11.1:
878
+ version "0.11.1"
879
+ resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.11.1.tgz#df0f719e7ab592c484d8b73ec10e215a503ab8cc"
880
+ integrity sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==
867
881
  dependencies:
868
882
  jsonc-parser "^3.0.0"
869
883
  vscode-oniguruma "^1.6.1"
870
- vscode-textmate "5.2.0"
884
+ vscode-textmate "^6.0.0"
871
885
 
872
886
  slash@^3.0.0:
873
887
  version "3.0.0"
@@ -947,16 +961,15 @@ type-fest@^0.20.2:
947
961
  resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
948
962
  integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
949
963
 
950
- typedoc@^0.22.10:
951
- version "0.22.10"
952
- resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.10.tgz#221e1a2b17bcb71817ef027dc4c4969d572e7620"
953
- integrity sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==
964
+ typedoc@^0.23.21:
965
+ version "0.23.21"
966
+ resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.23.21.tgz#2a6b0e155f91ffa9689086706ad7e3e4bc11d241"
967
+ integrity sha512-VNE9Jv7BgclvyH9moi2mluneSviD43dCE9pY8RWkO88/DrEgJZk9KpUk7WO468c9WWs/+aG6dOnoH7ccjnErhg==
954
968
  dependencies:
955
- glob "^7.2.0"
956
969
  lunr "^2.3.9"
957
- marked "^3.0.8"
958
- minimatch "^3.0.4"
959
- shiki "^0.9.12"
970
+ marked "^4.0.19"
971
+ minimatch "^5.1.0"
972
+ shiki "^0.11.1"
960
973
 
961
974
  typescript@^4.5.2:
962
975
  version "4.5.4"
@@ -980,10 +993,10 @@ vscode-oniguruma@^1.6.1:
980
993
  resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz#2bf4dfcfe3dd2e56eb549a3068c8ee39e6c30ce5"
981
994
  integrity sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==
982
995
 
983
- vscode-textmate@5.2.0:
984
- version "5.2.0"
985
- resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e"
986
- integrity sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==
996
+ vscode-textmate@^6.0.0:
997
+ version "6.0.0"
998
+ resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-6.0.0.tgz#a3777197235036814ac9a92451492f2748589210"
999
+ integrity sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==
987
1000
 
988
1001
  which@^2.0.1:
989
1002
  version "2.0.2"