Skip to content

feat(playwright): add durable settings browser test suite#5773

Open
BillLeoutsakosvl346 wants to merge 14 commits into
stagingfrom
e2e/settings-playwright
Open

feat(playwright): add durable settings browser test suite#5773
BillLeoutsakosvl346 wants to merge 14 commits into
stagingfrom
e2e/settings-playwright

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • establish a reusable Playwright foundation for full-stack browser coverage
  • add deterministic authenticated personas spanning workspace, organization, plan, and platform authority
  • cover settings navigation, authorization, entitlements, and critical workflows across account, organization, and workspace routes

Delivery plan

  • Playwright foundation and hosted/billing Chromium profile
  • Reusable data, Better Auth, and persona fixtures
  • Settings navigation acceptance contract
  • Authorization, entitlement, and unsaved-change coverage
  • Secrets and API-key workflows
  • Organization and enterprise workflows
  • Stability validation and required CI gate

Test plan

  • Existing Vitest and build checks remain green
  • Settings E2E suite runs against migrated isolated pgvector/Postgres
  • Playwright reports, traces, and screenshots upload on failure
  • Full Chromium suite passes five consecutive runs with retries disabled

This is the draft integration PR. Each delivery step will be reviewed in a focused PR targeting e2e/settings-playwright before this PR is made ready for final review.

Made with Cursor

Allow focused child PRs to receive normal CI before the completed suite returns to staging.
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 23, 2026 5:58pm

Request Review

* test(e2e): add reusable Playwright foundation

Establish a hermetic full-stack browser harness so settings and future surfaces can exercise real authentication, APIs, and isolated database state safely.

* test(e2e): harden runner lifecycle and artifacts

Fail closed on stale processes, preserve cleanup during interruption, and keep credentials and personal fixture data out of uploaded diagnostics.

* test(e2e): tighten isolation and shutdown guards

Make destructive database operations and service bindings strictly local while ensuring interrupted runs fully stop managed children before cleanup.

* test(e2e): finalize harness safety boundaries

Close the remaining lifecycle, credential-isolation, and CLI escape hatches so future persona and settings suites can build on a fail-closed foundation.

* test(e2e): harden interrupted-run cleanup

Use a detached cleanup supervisor so repeated signals cannot interrupt process-group shutdown or forced removal of the guarded run database.

* test(e2e): guard signal cleanup edge cases

Prevent empty process-group targets and verify forced-drop retries against final database state so interrupted runs cannot self-signal or report false cleanup failures.

* test(e2e): require exact host and race-safe signals

Reject dual-stack host mappings that cannot reach IPv4-only services and tolerate child exit races during process-group signal fallback.

* test(e2e): force IPv4 for hosted test origin

Accept safe dual-stack loopback resolution while pinning Chromium and Node traffic to 127.0.0.1 so CI reaches IPv4-only services reliably.

* test(e2e): settle readiness exit race

Mark successful readiness before the managed process completion branch can reject, preventing later normal shutdown from surfacing an abandoned promise failure.

* test(e2e): propagate IPv4 preference to probes

Keep Node-based Playwright requests on the same IPv4 path as Chromium and use direct loopback for orchestrator probes under dual-stack CI DNS.

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
* Add safe E2E build reuse and environment isolation

Separate build-time inputs from per-run services so verified artifacts can accelerate local iteration without weakening fresh database or provider boundaries.

* Add validated E2E persona world model

Model settings personas as deterministic, serializable resource graphs and provide production-first factories with exact-ID cleanup so impossible or cross-world fixture states fail before browser tests run.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Seed and verify E2E settings personas

Provision the validated world through real product boundaries, capture isolated sessions through the login UI, and assert persona contracts plus two-worker cross-world isolation without exposing credentials to Playwright.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Harden E2E persona orchestration and remove deferred cleanup

Generate runtime secrets per run, fail closed when diagnostics cannot be scanned, and harden cache and process cleanup while removing the unused exact-ID cleanup module until retained-stack support has a real consumer.

* Fix CI option policy assertions

Make local-only parser scenarios explicit so the safety suite tests the intended policy instead of inheriting the GitHub runner environment.

* Fix organization invitation fixture semantics

Match production organization invitations even when workspace grants are attached, and remove an unused cookie-reset method from the E2E client.

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden Playwright lifecycle and persona fidelity

Close production-state and cleanup gaps so the settings E2E platform fails closed without sacrificing useful diagnostics.

* Serialize E2E signal cleanup ownership

Prevent opposite signals and normal finalization from racing detached cleanup or releasing its run lock.

* Preserve browser fixture failures

Report network isolation violations without masking the original Playwright test or fixture error.

* Make E2E signal handoff resilient

Keep cleanup single-flight across repeated signals and retain lock ownership when supervisor logging or startup fails.

* fix(e2e): preserve replacement org coverage

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(e2e): derive usage from entitled coverage

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(e2e): serialize cleanup lock ownership

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ci): detect safe E2E diagnostics directly

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add settings navigation acceptance contracts

Co-authored-by: Cursor <cursoragent@cursor.com>

* Support IPv6 loopback in E2E database guard

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add settings authorization acceptance contracts

Co-authored-by: Cursor <cursoragent@cursor.com>

* Clarify authorization readiness states

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(e2e): cover credential settings workflows

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(e2e): address credential review findings

Co-authored-by: Cursor <cursoragent@cursor.com>

* style(e2e): format credential helper

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(settings): prioritize API key load errors

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(e2e): add enterprise workflow coverage

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(e2e): harden workflow readiness invariants

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(e2e): cover enterprise integrations

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(sso): preserve uniqueness during migration replay

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix settings e2e and sso route contracts

Co-authored-by: Cursor <cursoragent@cursor.com>

* serialize sso provider mutations

Co-authored-by: Cursor <cursoragent@cursor.com>

* close sso account link races

Co-authored-by: Cursor <cursoragent@cursor.com>

* normalize sso overlap comparisons

Co-authored-by: Cursor <cursoragent@cursor.com>

* serialize sso domain verification

Co-authored-by: Cursor <cursoragent@cursor.com>

* allow sso cleanup after plan loss

Co-authored-by: Cursor <cursoragent@cursor.com>

* refresh sso provider inside mutation lock

Co-authored-by: Cursor <cursoragent@cursor.com>

* harden sso update and delete concurrency

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(sso): avoid long-held callback mutation locks

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(sso): release mutation lock during DNS verification

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(sso): normalize audited domain overlaps

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(e2e): override auth endpoint rate limits

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(e2e): finalize settings suite stabilization

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(helm): tolerate retired SSO preflight keys

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Mac.localdomain>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
Bill Leoutsakos and others added 2 commits July 23, 2026 10:50
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e60658d. Configure here.

Comment thread .github/workflows/ci.yml
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR establishes durable settings browser coverage and the supporting production hardening.

  • Adds full-stack Playwright orchestration, deterministic personas, isolated Postgres setup, fake Stripe/MCP services, diagnostics safeguards, and a required CI job.
  • Adds settings authorization, navigation, credential, organization, SSO, MCP, retention, and entitlement coverage.
  • Introduces SSO domain verification, provider-management safeguards, migration preflight/auditing, and deployment configuration.
  • Updates settings UI state and access behavior to support deterministic browser workflows.

Confidence Score: 5/5

The PR appears safe to merge based on the reviewed migration, authentication, realtime, CI, and diagnostics paths.

The changed paths preserve organization authorization and provider integrity, use guarded and replay-aware migration handling, isolate browser-test infrastructure, accept the configured browser origin, and gate diagnostic uploads on successful secret-leak scanning.

Important Files Changed

Filename Overview
.github/workflows/test-build.yml Adds the required settings E2E job with Postgres, migration rehearsal, browser installation, diagnostics gating, and artifact upload.
apps/sim/e2e/scripts/run.ts Orchestrates isolated database creation, services, build, seeding, authentication capture, Playwright execution, leak scanning, and cleanup.
apps/sim/e2e/support/deployment-profile.ts Defines isolated, explicit environment profiles for each full-stack E2E subprocess.
apps/sim/playwright.config.ts Configures ordered Chromium projects and failure artifacts for the settings acceptance suite.
packages/db/migrations/0266_zippy_the_phantom.sql Adds SSO provider integrity constraints, domain-verification state, and concurrent uniqueness indexes behind migration preflight checks.
packages/db/scripts/migrate.ts Adds the guarded SSO migration audit while retaining migration locking, retry, and invalid-index diagnostics.
apps/sim/lib/auth/sso/management.ts Centralizes organization authorization, provider validation, domain overlap checks, and mutation availability safeguards.
apps/sim/lib/auth/sso/provider-operation-intent.ts Coordinates provider callbacks and domain verification with expiring operation intents.
apps/sim/app/api/auth/[...all]/route.ts Wraps SSO callbacks with operation tracking and blocks direct access to provider mutation endpoints.
apps/realtime/src/index.ts Adds configurable host binding needed by isolated E2E runtime startup.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CI[Settings E2E CI job] --> PG[(Isolated pgvector/Postgres)]
  CI --> Runner[E2E orchestrator]
  Runner --> Migration[Migration and SSO rehearsal]
  Runner --> Stripe[Fake Stripe service]
  Runner --> MCP[Fake MCP service]
  Runner --> Realtime[Realtime service]
  Runner --> App[Production Next.js app]
  Runner --> Seed[Deterministic personas and scenarios]
  Seed --> PG
  Runner --> Browser[Playwright Chromium projects]
  Browser --> App
  Browser --> Realtime
  App --> PG
  App --> Stripe
  App --> MCP
  Browser --> Diagnostics[Reports, traces, screenshots]
  Diagnostics --> LeakScan[Leak-canary gate]
  LeakScan --> Artifacts[Conditional CI artifact upload]
Loading

Reviews (1): Last reviewed commit: "chore(ci): update API validation route b..." | Re-trigger Greptile

@BillLeoutsakosvl346
BillLeoutsakosvl346 marked this pull request as ready for review July 23, 2026 18:09
@BillLeoutsakosvl346
BillLeoutsakosvl346 requested a review from a team as a code owner July 23, 2026 18:09
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (211 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

@icecrasher321 icecrasher321 changed the title Add durable settings browser test suite feat(playwright): add durable settings browser test suite Jul 23, 2026
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