Skip to content

Commit 8e27d23

Browse files
authored
feat: dep upgrades and run ci against ventura (#11)
* ci: run against ventura * chore: upgrade dependencies
1 parent 4cb7da2 commit 8e27d23

19 files changed

+753
-375
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 18
14+
node-version: 20
1515
registry-url: https://registry.npmjs.org/
1616
always-auth: true
1717
- run: yarn install --frozen-lockfile

.github/workflows/test-voiceover.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
os: [macos-11, macos-12]
14+
os: [macos-11, macos-12, macos-13]
1515
browser: [chromium, firefox, webkit]
1616
steps:
1717
- uses: actions/checkout@v3
1818
- uses: actions/setup-node@v3
1919
with:
20-
node-version: 18
20+
node-version: 20
2121
- name: Guidepup Setup
22-
uses: guidepup/setup-action@0.8.1
22+
uses: guidepup/setup-action@0.13.0
2323
with:
2424
record: true
2525
- run: yarn install --frozen-lockfile
@@ -32,4 +32,4 @@ jobs:
3232
name: artifacts
3333
path: |
3434
**/test-results/**/*
35-
**/recordings/**/*
35+
**/recordings/**/*

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
- uses: actions/checkout@v3
1414
- uses: actions/setup-node@v3
1515
with:
16-
node-version: 18
16+
node-version: 20
1717
- run: yarn install --frozen-lockfile
1818
- run: yarn ci

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import { voConfig } from "@guidepup/playwright";
8282

8383
const config: PlaywrightTestConfig = {
8484
...voConfig,
85-
85+
8686
// Your custom config ...
8787
};
8888

@@ -103,7 +103,7 @@ If you are using GitHub Actions, check out the dedicated [`guidepup/setup-action
103103
104104
```yaml
105105
- name: Setup Environment
106-
uses: guidepup/setup-action@0.8.1
106+
uses: guidepup/setup-action@0.13.0
107107
```
108108
109109
## Documentation

example/chromium.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ import { devices, PlaywrightTestConfig } from "@playwright/test";
22

33
const config: PlaywrightTestConfig = {
44
reportSlowTests: null,
5+
fullyParallel: false,
56
workers: 1,
6-
timeout: 3 * 60 * 1000,
7-
retries: 2,
7+
timeout: 5 * 60 * 1000,
8+
retries: 5,
89
projects: [
910
{
1011
name: "chromium",
1112
use: { ...devices["Desktop Chrome"], headless: false, video: "on" },
1213
},
1314
],
15+
reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "list",
1416
};
1517

1618
export default config;

example/firefox.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ import { devices, PlaywrightTestConfig } from "@playwright/test";
22

33
const config: PlaywrightTestConfig = {
44
reportSlowTests: null,
5+
fullyParallel: false,
56
workers: 1,
6-
timeout: 3 * 60 * 1000,
7-
retries: 2,
7+
timeout: 5 * 60 * 1000,
8+
retries: 5,
89
projects: [
910
{
1011
name: "firefox",
1112
use: { ...devices["Desktop Firefox"], headless: false, video: "on" },
1213
},
1314
],
15+
reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "list",
1416
};
1517

1618
export default config;
Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,57 @@
1-
import { expect } from "@playwright/test";
1+
import { platform, release } from "os";
22
import { headerNavigation } from "../headerNavigation";
33
import itemTextSnapshot from "./chromium.itemText.snapshot.json";
4+
import { logIncludesExpectedPhrases } from "../logIncludesExpectedPhrases";
45
import { macOSRecord } from "@guidepup/guidepup";
56
import spokenPhraseSnapshot from "./chromium.spokenPhrase.snapshot.json";
67
import { voTest as test } from "../../../src";
78

89
test.describe("Chromium Playwright VoiceOver", () => {
910
test("I can navigate the Guidepup Github page", async ({
11+
browser,
12+
browserName,
1013
page,
1114
voiceOver,
1215
}) => {
13-
const stopRecording = macOSRecord(
14-
`./recordings/playwright-voiceover-chromium-${+new Date()}.mov`
15-
);
16+
const osName = platform();
17+
const osVersion = release();
18+
const browserVersion = browser.version();
19+
const { retry } = test.info();
20+
const recordingFilePath = `./recordings/playwright-voiceover-${osName}-${osVersion}-${browserName}-${browserVersion}-attempt-${retry}-${+new Date()}.mov`;
1621

17-
await headerNavigation({ page, voiceOver });
22+
console.table({
23+
osName,
24+
osVersion,
25+
browserName,
26+
browserVersion,
27+
retry,
28+
});
1829

19-
// Assert that we've ended up where we expected and what we were told on
20-
// the way there is as expected.
30+
let stopRecording: (() => void) | undefined;
2131

22-
const itemTextLog = await voiceOver.itemTextLog();
23-
const spokenPhraseLog = await voiceOver.spokenPhraseLog();
32+
try {
33+
const isMacOSVentura =
34+
osName === "darwin" && osVersion.split(".")[0] === "22";
2435

25-
console.log(JSON.stringify(itemTextLog, undefined, 2));
26-
console.log(JSON.stringify(spokenPhraseLog, undefined, 2));
36+
if (!isMacOSVentura) {
37+
stopRecording = macOSRecord(recordingFilePath);
38+
}
2739

28-
for (const expectedItem of itemTextSnapshot) {
29-
expect(!!itemTextLog.find((log) => log.includes(expectedItem))).toBe(
30-
true
31-
);
32-
}
40+
await headerNavigation({ page, voiceOver });
3341

34-
for (const expectedPhrase of spokenPhraseSnapshot) {
35-
expect(
36-
!!spokenPhraseLog.find((log) => log.includes(expectedPhrase))
37-
).toBe(true);
38-
}
42+
// Assert that we've ended up where we expected and what we were told on
43+
// the way there is as expected.
44+
45+
const itemTextLog = await voiceOver.itemTextLog();
46+
const spokenPhraseLog = await voiceOver.spokenPhraseLog();
3947

40-
stopRecording();
48+
console.log(JSON.stringify(itemTextLog, undefined, 2));
49+
console.log(JSON.stringify(spokenPhraseLog, undefined, 2));
50+
51+
logIncludesExpectedPhrases(itemTextLog, itemTextSnapshot);
52+
logIncludesExpectedPhrases(spokenPhraseLog, spokenPhraseSnapshot);
53+
} finally {
54+
stopRecording?.();
55+
}
4156
});
4257
});
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
2-
"heading level 1 guidepup/guidepup. You are currently on a heading level 1.",
3-
"heading level 2 Latest commit. You are currently on a heading level 2.",
4-
"heading level 2 Git stats. You are currently on a heading level 2.",
5-
"heading level 2 Files. You are currently on a heading level 2.",
6-
"heading level 2 link README.md. You are currently on a heading level 2.",
7-
"heading level 1 Guidepup. You are currently on a heading level 1."
2+
"heading level 1 guidepup/guidepup",
3+
"heading level 2 Latest commit",
4+
"heading level 2 Git stats",
5+
"heading level 2 Files",
6+
"heading level 2 link README.md",
7+
"heading level 1 Guidepup"
88
]

example/tests/firefox/firefox.spec.ts

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,57 @@
1-
import { expect } from "@playwright/test";
1+
import { platform, release } from "os";
22
import { headerNavigation } from "../headerNavigation";
33
import itemTextSnapshot from "./firefox.itemText.snapshot.json";
4+
import { logIncludesExpectedPhrases } from "../logIncludesExpectedPhrases";
45
import { macOSRecord } from "@guidepup/guidepup";
56
import spokenPhraseSnapshot from "./firefox.spokenPhrase.snapshot.json";
67
import { voTest as test } from "../../../src";
78

89
test.describe("Firefox Playwright VoiceOver", () => {
910
test("I can navigate the Guidepup Github page", async ({
11+
browser,
12+
browserName,
1013
page,
1114
voiceOver,
1215
}) => {
13-
const stopRecording = macOSRecord(
14-
`./recordings/playwright-voiceover-firefox-${+new Date()}.mov`
15-
);
16+
const osName = platform();
17+
const osVersion = release();
18+
const browserVersion = browser.version();
19+
const { retry } = test.info();
20+
const recordingFilePath = `./recordings/playwright-voiceover-${osName}-${osVersion}-${browserName}-${browserVersion}-attempt-${retry}-${+new Date()}.mov`;
1621

17-
await headerNavigation({ page, voiceOver });
22+
console.table({
23+
osName,
24+
osVersion,
25+
browserName,
26+
browserVersion,
27+
retry,
28+
});
1829

19-
// Assert that we've ended up where we expected and what we were told on
20-
// the way there is as expected.
30+
let stopRecording: (() => void) | undefined;
2131

22-
const itemTextLog = await voiceOver.itemTextLog();
23-
const spokenPhraseLog = await voiceOver.spokenPhraseLog();
32+
try {
33+
const isMacOSVentura =
34+
osName === "darwin" && osVersion.split(".")[0] === "22";
2435

25-
console.log(JSON.stringify(itemTextLog, undefined, 2));
26-
console.log(JSON.stringify(spokenPhraseLog, undefined, 2));
36+
if (!isMacOSVentura) {
37+
stopRecording = macOSRecord(recordingFilePath);
38+
}
2739

28-
for (const expectedItem of itemTextSnapshot) {
29-
expect(!!itemTextLog.find((log) => log.includes(expectedItem))).toBe(
30-
true
31-
);
32-
}
40+
await headerNavigation({ page, voiceOver });
3341

34-
for (const expectedPhrase of spokenPhraseSnapshot) {
35-
expect(
36-
!!spokenPhraseLog.find((log) => log.includes(expectedPhrase))
37-
).toBe(true);
38-
}
42+
// Assert that we've ended up where we expected and what we were told on
43+
// the way there is as expected.
44+
45+
const itemTextLog = await voiceOver.itemTextLog();
46+
const spokenPhraseLog = await voiceOver.spokenPhraseLog();
3947

40-
stopRecording();
48+
console.log(JSON.stringify(itemTextLog, undefined, 2));
49+
console.log(JSON.stringify(spokenPhraseLog, undefined, 2));
50+
51+
logIncludesExpectedPhrases(itemTextLog, itemTextSnapshot);
52+
logIncludesExpectedPhrases(spokenPhraseLog, spokenPhraseSnapshot);
53+
} finally {
54+
stopRecording?.();
55+
}
4156
});
4257
});

0 commit comments

Comments
 (0)