Skip to content

Include mutation flow in local E2E#107

Merged
BASIC-BIT merged 1 commit into
mainfrom
test/include-local-e2e-flow
May 30, 2026
Merged

Include mutation flow in local E2E#107
BASIC-BIT merged 1 commit into
mainfrom
test/include-local-e2e-flow

Conversation

@BASIC-BIT
Copy link
Copy Markdown
Owner

@BASIC-BIT BASIC-BIT commented May 30, 2026

What changed

  • Makes local Playwright webserver runs default the existing token-gated E2E helper env.
  • Includes the mutation-backed @flow profile submission journey in pnpm test:e2e by excluding only visual/snapshot suites.
  • Updates the Playwright testing docs so the local command reflects smoke plus mutation coverage.

Why

Closes a concrete issue #100 acceptance gap: the normal local E2E command should include at least one mutation-backed journey, not only public render checks.

Testing

Risk

Local-only Playwright startup behavior changes. Hosted and production smoke modes still require explicit PLAYWRIGHT_BASE_URL; hosted smoke still excludes @flow, and production E2E helpers remain blocked by the route guard.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vr-dex-web Ready Ready Preview, Comment May 30, 2026 11:03pm

Request Review

@github-actions
Copy link
Copy Markdown

Playwright Hosted Data-Flow

Outcome: success
Target: https://staging.vrdex.net
Run: https://github.com/BASIC-BIT/VRDex/actions/runs/26697296794
Artifact: playwright-hosted-data-flow

This optional check runs the mutation-backed profile flow against a configured hosted dev/staging target with isolated E2E test data.

@github-actions
Copy link
Copy Markdown

Playwright Data-Flow Preview

Outcome: success
Run: https://github.com/BASIC-BIT/VRDex/actions/runs/26697296794
Artifact: playwright-data-flow

Captured flow:

  • test-gated profile submission form
  • gated helper rejection without the Playwright token
  • Convex profile creation
  • submission success state
  • public profile page readback
  • discovery search readback

Artifacts include screenshots, traces, and recorded video for the flow run.

@github-actions
Copy link
Copy Markdown

Playwright Public Screenshot Preview

Outcome: success
Run: https://github.com/BASIC-BIT/VRDex/actions/runs/26697296794
Artifact: playwright-public-preview

Screenshots: all public route checks passed on desktop and mobile.

Full screenshot set is available in the artifact. Pixel diff baselines are handled by the separate Playwright Image Diff check.

@github-actions
Copy link
Copy Markdown

Playwright Image Diff

Outcome: success
Run: https://github.com/BASIC-BIT/VRDex/actions/runs/26697296794
Artifact: playwright-image-diff

Changed screenshot baselines: none in this PR.

This check compares public route screenshots against committed baselines. Inline images show only added or modified baseline PNGs.

@BASIC-BIT BASIC-BIT marked this pull request as ready for review May 30, 2026 23:06
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@BASIC-BIT BASIC-BIT merged commit 80a7735 into main May 30, 2026
18 checks passed
@BASIC-BIT BASIC-BIT deleted the test/include-local-e2e-flow branch May 30, 2026 23:06
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 30, 2026

Greptile Summary

This PR enables the mutation-backed @flow E2E journey to run automatically with pnpm test:e2e by defaulting token-gated E2E helper env vars for local (non-hosted) Playwright runs, closing the local coverage gap noted in issue #100.

  • package.json: Removes @flow from the test:e2e grep-invert pattern so the profile-submission mutation journey now runs alongside public route smoke tests locally.
  • playwright.config.mjs: Introduces localE2eHelperEnv that defaults VRDEX_ENABLE_E2E_HELPERS, VRDEX_E2E_BROWSER_TOKEN, and VRDEX_E2E_CONVEX_SECRET for local webserver runs; hosted and production smoke modes are unchanged.
  • docs/testing/playwright-visual-preview.md: Updates command descriptions and the explanatory prose to reflect that pnpm test:e2e now covers both smoke and mutation flow locally without additional env setup.

Confidence Score: 4/5

Safe to merge; the change only affects local developer E2E runs and leaves hosted, smoke, and production modes untouched.

The logic is sound — localE2eHelperEnv correctly gates on !hostedBaseURL so credential defaults never leak into hosted or production runs. The one nit is a dead-code ?? 'true' fallback that is unreachable but harmless. Everything else — the grep-invert adjustment, the env spreading order, and the escape-hatch via explicit VRDEX_ENABLE_E2E_HELPERS=false — behaves as intended.

No files require special attention beyond the minor redundancy in playwright.config.mjs.

Important Files Changed

Filename Overview
apps/web/playwright.config.mjs Introduces localE2eHelperEnv to default E2E helper credentials for local runs; contains a minor dead-code nit (redundant ?? "true" fallback) but is otherwise logically correct and host-mode safe.
apps/web/package.json Removes @flow from the test:e2e grep-invert pattern; hosted/smoke/snapshot scripts are unaffected. Change is intentional and consistent with the config update.
docs/testing/playwright-visual-preview.md Updates command descriptions and explanatory prose; accurate and consistent with the code changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[pnpm test:e2e] --> B{PLAYWRIGHT_BASE_URL set?}
    B -- No / Local --> C[hostedBaseURL = undefined]
    B -- Yes / Hosted --> D[hostedBaseURL = URL]

    C --> E["e2eHelpersEnabled = VRDEX_ENABLE_E2E_HELPERS ?? 'true'"]
    D --> F["e2eHelpersEnabled = VRDEX_ENABLE_E2E_HELPERS ?? undefined"]

    E --> G["localE2eHelperEnv = {VRDEX_ENABLE_E2E_HELPERS, VRDEX_E2E_BROWSER_TOKEN ?? 'local-playwright-token', VRDEX_E2E_CONVEX_SECRET ?? 'local-convex-e2e-secret'}"]
    F --> H["localE2eHelperEnv = {}"]

    G --> I[sharedEnv spread into webServer.env]
    H --> I

    I --> J[Convex dev server]
    I --> K[Next dev server]

    K --> L{grep-invert pattern}
    L -- test:e2e --> M["exclude @visual | @snapshot (includes @flow ✓)"]
    L -- test:e2e:hosted:smoke --> N["exclude @visual | @flow | @snapshot (production-safe only)"]
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/web/playwright.config.mjs:25
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,
```

Reviews (1): Last reviewed commit: "Include mutation flow in local E2E" | Re-trigger Greptile

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant