Skip to content

Commit d9b884d

Browse files
committed
feat: also test mobile browsers
Signed-off-by: Sebastian Davids <[email protected]>
1 parent 2050f42 commit d9b884d

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

hp/e2e/tests/index.test.mjs

+37-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ test.describe('homepage - a11y', () => {
1717
expect(accessibilityScanResults.violations).toEqual([]);
1818
});
1919

20-
test('should have stable aria tree', async ({ page }) => {
20+
test('should have stable aria tree - desktop', async ({ page, isMobile }) => {
21+
test.skip(isMobile);
2122
await expect(page.getByRole('main')).toMatchAriaSnapshot(`
2223
- main:
2324
- article "Sebastian Davids":
@@ -54,6 +55,41 @@ test.describe('homepage - a11y', () => {
5455
- paragraph: /© \\d+-\\d+ Sebastian Davids/
5556
`);
5657
});
58+
59+
test('should have stable aria tree - mobile', async ({ page, isMobile }) => {
60+
test.skip(!isMobile);
61+
await expect(page.getByRole('main')).toMatchAriaSnapshot(`
62+
- main:
63+
- article "Sebastian Davids":
64+
- heading "Sebastian Davids" [level=1]
65+
- region "Email address":
66+
- heading "Email address" [level=2]
67+
68+
- region "iMessage":
69+
- heading "iMessage" [level=2]
70+
- text: APKTIDVw2zk8ZQeSkpWLUD9UGIhH00TtYdMRkryMUZUtBJRxeCSA
71+
- group:
72+
- heading "Usage" [level=3]
73+
- region "GPG":
74+
- heading "GPG" [level=2]
75+
- link "GPG public key": Public key
76+
- link "keys.openpgp.org"
77+
- text: 3B05 1F8E AA0B 63D1 7220\\a 168C 99A9 7C77 8DCD F19F
78+
- region "age":
79+
- heading "age" [level=2]
80+
- link "age public key": Public key
81+
`);
82+
await expect(page.getByRole('contentinfo')).toMatchAriaSnapshot(`
83+
- contentinfo:
84+
- navigation "social links":
85+
- list:
86+
- listitem:
87+
- link "GitHub"
88+
- listitem:
89+
- link "Gravatar"
90+
- paragraph: /© \\d+-\\d+ Sebastian Davids/
91+
`);
92+
});
5793
});
5894

5995
test.describe('homepage - light mode', () => {

hp/playwright.config.mjs

+24
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ const projects = [
1818
use: { ...devices['Desktop Chrome'], channel: 'chromium' },
1919
testIgnore: '**/*.smoke.test.mjs',
2020
},
21+
{
22+
name: 'chromium-mobile',
23+
// https://endoflife.date/pixel
24+
use: { ...devices['Pixel 7'], channel: 'chromium' },
25+
testIgnore: '**/*.smoke.test.mjs',
26+
},
27+
{
28+
name: 'chromium-mobile-landscape',
29+
// https://endoflife.date/pixel
30+
use: { ...devices['Pixel 7 landscape'], channel: 'chromium' },
31+
testIgnore: '**/*.smoke.test.mjs',
32+
},
2133
{
2234
name: 'firefox',
2335
use: { ...devices['Desktop Firefox'] },
@@ -38,6 +50,18 @@ if (os.platform() === 'darwin') {
3850
use: { ...devices['Desktop Safari'] },
3951
testIgnore: '**/*.smoke.test.mjs',
4052
});
53+
projects.push({
54+
name: 'safari-mobile',
55+
// https://endoflife.date/iphone
56+
use: { ...devices['iPhone 11'] },
57+
testIgnore: '**/*.smoke.test.mjs',
58+
});
59+
projects.push({
60+
name: 'safari-mobile-landscape',
61+
// https://endoflife.date/iphone
62+
use: { ...devices['iPhone 11 landscape'] },
63+
testIgnore: '**/*.smoke.test.mjs',
64+
});
4165
}
4266
}
4367
}

0 commit comments

Comments
 (0)