Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"check:vercel-env": "node ./scripts/check-vercel-env.mjs",
"start": "next start",
"lint": "eslint",
"test:e2e": "playwright test --grep-invert \"@visual|@flow|@snapshot\"",
"test:e2e": "playwright test --grep-invert \"@visual|@snapshot\"",
"test:e2e:hosted": "playwright test --grep @flow --project=desktop-chromium",
"test:e2e:hosted:smoke": "playwright test --grep-invert \"@visual|@flow|@snapshot\"",
"test:e2e:snapshots": "playwright test --grep @snapshot",
Expand Down
11 changes: 10 additions & 1 deletion apps/web/playwright.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ const reuseConvexServer = process.env.PLAYWRIGHT_REUSE_CONVEX === "true";
const skipWebServers = process.env.PLAYWRIGHT_SKIP_WEBSERVERS === "true" || Boolean(hostedBaseURL);
const skipConvexServer = skipWebServers || process.env.PLAYWRIGHT_SKIP_CONVEX_DEV === "true";
const recordVideo = process.env.PLAYWRIGHT_RECORD_VIDEO === "true";
const e2eHelpersEnabled = process.env.VRDEX_ENABLE_E2E_HELPERS ?? (hostedBaseURL ? undefined : "true");
const allowFixtureSearchFallthrough =
process.env.VRDEX_ALLOW_PLAYWRIGHT_FIXTURE_SEARCH_FALLTHROUGH === "true" ||
process.env.VRDEX_ENABLE_E2E_HELPERS === "true";
e2eHelpersEnabled === "true";
const localE2eHelperEnv = hostedBaseURL
? {}
: {
VRDEX_ENABLE_E2E_HELPERS: e2eHelpersEnabled ?? "true",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The ?? "true" fallback on this line is unreachable. In the non-hosted branch, e2eHelpersEnabled is always process.env.VRDEX_ENABLE_E2E_HELPERS ?? "true" — a string, never null or undefined — so the nullish coalescing here never fires. Dropping it makes the intent clearer.

Suggested change
VRDEX_ENABLE_E2E_HELPERS: e2eHelpersEnabled ?? "true",
VRDEX_ENABLE_E2E_HELPERS: e2eHelpersEnabled,
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/playwright.config.mjs
Line: 25

Comment:
The `?? "true"` fallback on this line is unreachable. In the non-hosted branch, `e2eHelpersEnabled` is always `process.env.VRDEX_ENABLE_E2E_HELPERS ?? "true"` — a string, never `null` or `undefined` — so the nullish coalescing here never fires. Dropping it makes the intent clearer.

```suggestion
      VRDEX_ENABLE_E2E_HELPERS: e2eHelpersEnabled,
```

How can I resolve this? If you propose a fix, please make it concise.

VRDEX_E2E_BROWSER_TOKEN: process.env.VRDEX_E2E_BROWSER_TOKEN ?? "local-playwright-token",
VRDEX_E2E_CONVEX_SECRET: process.env.VRDEX_E2E_CONVEX_SECRET ?? "local-convex-e2e-secret",
};

if (!hostedBaseURL) {
process.env.CONVEX_URL = convexUrl;
Expand All @@ -29,6 +37,7 @@ const sharedEnv = {
CONVEX_URL: convexUrl,
NEXT_PUBLIC_CONVEX_URL: convexUrl,
VRDEX_ENABLE_PLAYWRIGHT_FIXTURES: "true",
...localE2eHelperEnv,
...(allowFixtureSearchFallthrough
? { VRDEX_ALLOW_PLAYWRIGHT_FIXTURE_SEARCH_FALLTHROUGH: "true" }
: {}),
Expand Down
4 changes: 2 additions & 2 deletions docs/testing/playwright-visual-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ See `docs/testing/playwright-image-diffing.md` for the committed-baseline image

## Local commands

- Smoke public routes: `pnpm test:e2e`
- Smoke public routes and run the local mutation-backed data flow: `pnpm test:e2e`
- Capture public route screenshots: `pnpm test:e2e:visual`
- Compare public route screenshots against baselines: `pnpm test:e2e:snapshots`
- Update public route screenshot baselines: `pnpm test:e2e:snapshots:update`
Expand Down Expand Up @@ -50,7 +50,7 @@ POSIX shell hosted production smoke run:
PLAYWRIGHT_BASE_URL=https://vrdex.net PLAYWRIGHT_SKIP_WEBSERVERS=true pnpm test:e2e:hosted:smoke
```

The visual suite starts a local Convex backend and Next dev server by default. Setting `PLAYWRIGHT_BASE_URL` switches Playwright to hosted mode and disables local web servers. Profile screenshots use deterministic Next-server fixtures when `VRDEX_ENABLE_PLAYWRIGHT_FIXTURES=true`, while `/server-status` still exercises the real local Convex health query. Fixture profiles are disabled when `NODE_ENV=production`.
The local Playwright suite starts a local Convex backend and Next dev server by default. Setting `PLAYWRIGHT_BASE_URL` switches Playwright to hosted mode and disables local web servers. Local webserver runs set token-gated E2E helper defaults so `pnpm test:e2e` includes the mutation-backed `@flow` journey without additional env setup. Profile screenshots use deterministic Next-server fixtures when `VRDEX_ENABLE_PLAYWRIGHT_FIXTURES=true`, while `/server-status` still exercises the real local Convex health query. Fixture profiles are disabled when `NODE_ENV=production`.

## Captured routes

Expand Down
Loading