Skip to content

Commit c446fb0

Browse files
committed
Change image snapshots to aria tag diffs
1 parent 0b494bb commit c446fb0

6 files changed

Lines changed: 22 additions & 8 deletions

test/e2e/index.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ test.describe('home page', () => {
2121
await expect(cta).toHaveAttribute('href', '/signin');
2222

2323
// Snapshot the hero copy block (not the full page) to avoid the background
24-
// image. Baseline in test/e2e/index.spec.ts-snapshots/ (macOS-specific).
25-
await expect(page.locator('.hero-copy')).toHaveScreenshot('home-hero.png');
24+
// image. ARIA snapshot (text-based) so the baseline is cross-platform stable
25+
// — pixel screenshots need a per-OS baseline and break on Linux CI.
26+
await expect(page.locator('.hero-copy')).toMatchAriaSnapshot();
2627
});
2728

2829
// @test e2e: an already-authenticated visitor is shown the hero, but the CTA points to the
-209 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- heading "TDEI Workspaces" [level=1]
2+
- paragraph: TDEI Workspaces is an integrated editing platform for TDEI datasets. Workspaces provides tools and APIs for crafting and visualizing OpenSidewalks and GTFS Pathways data.
3+
- link "Sign In":
4+
- /url: /signin
5+
- link "Learn more about the TDEI":
6+
- /url: https://transitequity.cs.washington.edu/

test/e2e/signin.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ test('shows the sign-in form to an unauthenticated visitor', async ({ page }) =>
2828
await expect(form).toBeVisible();
2929
await expect(page.getByRole('heading', { name: 'Welcome!' })).toBeVisible();
3030

31-
// Visual snapshot of just the form card (full-page would include the
32-
// background image / fonts and be needlessly brittle). The baseline lives in
33-
// test/e2e/signin.spec.ts-snapshots/ and is regenerated with
34-
// `npx playwright test --update-snapshots`. NOTE: screenshots are
35-
// platform-specific, so a Linux CI baseline differs from this macOS one.
36-
await expect(form).toHaveScreenshot('signin-form.png');
31+
// Snapshot just the form card (full-page would include the background image /
32+
// fonts and be needlessly brittle). ARIA snapshot (text-based) so the baseline
33+
// is cross-platform stable; regenerate with `--update-snapshots`. Pixel
34+
// screenshots need a per-OS baseline and break on Linux CI.
35+
await expect(form).toMatchAriaSnapshot();
3736
});
3837

3938
// @test e2e: the toolbar doesn't show a username when the user is not logged in,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- heading "Welcome!" [level=1]
2+
- paragraph: Please login to your account.
3+
- text: TDEI Username
4+
- textbox "TDEI Username"
5+
- text: Enter the same username that you provide to use the TDEI API. Password
6+
- textbox "Password"
7+
- button "Show password":
8+
- button "Sign In" [disabled]
-30.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)