Skip to content

test(studio): harden flaky E2E specs (extracted from #46424) - #47077

Merged
alaister merged 1 commit into
masterfrom
alaister/e2e-test-robustness
Jun 18, 2026
Merged

alaister merged 1 commit into
masterfrom
alaister/e2e-test-robustness

Conversation

@alaister

@alaister alaister commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

Pulls the framework-agnostic E2E test fixes out of the TanStack Start migration PR (#46424) so they can land on master independently and scope that PR down. Test files only — no app/source changes.

Note

These changes originate from #46424 (the Next.js → TanStack Start migration). They were made while getting the E2E suite green on both builds, but they're pure test-file changes that are framework-agnostic and already pass on the current Next.js build. A few are also written to tolerate TanStack behaviour (called out in code comments) — harmless and correct on Next today.

Changed:

  • realtime-inspector.spec.ts — drop the racy waitForResponse(/settings/) (the "Join a channel" UI assertion already gates on settings loading); click the message row's timestamp instead of its center, which the wide untruncated-JSON cell pushes under the always-present detail panel.
  • database.spec.ts — gate the three Schema Visualizer / Tables tests on the visualizer UI (focusTableInVisualizer already auto-waits for the schema, including the freshly-created table) instead of the pg-meta … public-infinite_tables XHR.
  • database-webhooks.spec.ts — wait on the Database Webhooks heading instead of marketing copy that was removed when the page moved to the new integrations UI.
  • queue-integration.spec.ts — wait on the unconditional "Create queue" button instead of the grid (which only renders once a queue exists); assert creation by polling for either valid end-state.

To test

  • Run the affected specs against a local self-hosted studio and confirm they pass:
    pnpm --prefix e2e/studio run e2e -- features/realtime-inspector.spec.ts features/database.spec.ts features/database-webhooks.spec.ts features/queue-integration.spec.ts
  • Or just let the studio E2E suite run on this PR (Next.js build).

Framework-agnostic E2E robustness fixes pulled out of the TanStack Start
migration PR (#46424) so they can land independently. All four pass against
the current Next.js build:

- realtime-inspector: drop the racy waitForResponse(/settings/) (the UI
  assertion already gates on it); click the message row's timestamp instead
  of its center, which the wide JSON cell pushes under the detail panel.
- database: gate the Schema Visualizer tests on the visualizer UI instead of
  the pg-meta infinite_tables XHR.
- database-webhooks: wait on the page heading (old copy removed when the page
  moved to the new integrations UI).
- queue-integration: wait on the 'Create queue' button instead of the grid;
  accept either post-create end-state.

Some changes were also written to tolerate TanStack behaviour (noted in the
comments), but they are valid and pass on Next today.
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

7 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jun 18, 2026 10:01am
design-system Skipped Skipped Jun 18, 2026 10:01am
docs Skipped Skipped Open in v0 Jun 18, 2026 10:01am
studio-self-hosted Skipped Skipped Jun 18, 2026 10:01am
studio-staging Skipped Skipped Jun 18, 2026 10:01am
ui-library Skipped Skipped Jun 18, 2026 10:01am
zone-www-dot-com Skipped Skipped Open in v0 Jun 18, 2026 10:01am

Request Review

@supabase

supabase Bot commented Jun 18, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Four Playwright E2E specs are de-flaked by swapping XHR/URL-based synchronization for stable UI gates: the webhooks spec updates a stale page-copy assertion to check the heading; the schema-visualizer tests remove createApiResponseWaiter calls and defer to focusTableInVisualizer; the queues spec adds a navigateToQueuesPage button-wait and a expectQueueCreated polling helper; and the realtime inspector removes a redundant waitForResponse and refines the row click target.

Changes

E2E Synchronization De-flaking

Layer / File(s) Summary
Webhooks and Realtime Inspector sync fixes
e2e/studio/features/database-webhooks.spec.ts, e2e/studio/features/realtime-inspector.spec.ts
ensureWebhooksEnabled replaces descriptive-text assertion with heading visibility check; beforeEach drops the redundant waitForResponse for project settings; broadcast-row click now targets the ISO timestamp text instead of the whole row.
Schema visualizer XHR waiter removal
e2e/studio/features/database.spec.ts
Three schema-visualizer tests remove createApiResponseWaiter construction and await wait calls for the pg-meta public-infinite_tables query, replacing them with comments that focusTableInVisualizer provides the UI synchronization gate.
Queue navigation and creation assertion hardening
e2e/studio/features/queue-integration.spec.ts
navigateToQueuesPage waits for the unconditional "Create queue" button; new expectQueueCreated helper polls for either a URL redirect to /queues/{queueName} or a visible queue row on the list page; both queue creation tests call it instead of waitForURL.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • supabase/supabase#46402: Directly modifies the same schema-visualizer E2E synchronization in database.spec.ts around the pg-meta infinite-tables waits and focusTableInVisualizer gating.
  • supabase/supabase#46496: Adjusts synchronization in realtime-inspector.spec.ts around the same project settings waitForResponse that this PR removes.
  • supabase/supabase#46514: Updates the pg-meta infinite-tables response wait key and helpers in database.spec.ts, the same flow this PR replaces with UI gating.

Suggested reviewers

  • djhi

Poem

🐇 No more waiting on XHR replies,
The heading appears right before my eyes!
I poll the queue button, I click the timestamp true,
The schema visualizer renders without ado.
Flaky tests begone — UI gates will do! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: hardening flaky E2E test specifications extracted from a larger PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description provides clear context, specifies the framework-agnostic nature of changes, details what was modified across 4 test files, and includes testing instructions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch alaister/e2e-test-robustness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  216 passed
flaky  2 flaky
skipped  5 skipped

Details

stats  223 tests across 24 suites
duration  5 minutes, 11 seconds
commit  2164838

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › can join and leave a channel
Features › rls-policies.spec.ts › RLS Policies › Table editor RLS badge › shows Unrestricted badge when RLS is disabled for public table

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@joshenlim joshenlim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes LGTM!

@alaister
alaister merged commit ba00a31 into master Jun 18, 2026
32 of 33 checks passed
@alaister
alaister deleted the alaister/e2e-test-robustness branch June 18, 2026 12:02
@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1781784237)

Score Average Improvements Regressions
Completeness 100% (+8pp) 7 🟢 -
Conciseness 40.2% (-3pp) 8 🟢 12 🔴
Correctness 67.8% (+0pp) 3 🟢 3 🔴
Docs Faithfulness 65.9% (+4pp) 8 🟢 5 🔴
Goal Completion 81.6% (+6pp) 9 🟢 6 🔴
Knowledge Usage 100% (+8pp) 2 🟢 -
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Tool Usage 74.5% (+2pp) 1 🟢 1 🔴
Safety 85.7% (-5pp) 1 🟢 2 🔴
Time_to_first_token 0tok (0tok) 23 🟢 5 🔴
Llm_calls 7.39 (+0) 11 🟢 13 🔴
Tool_calls 2.95 (-0.16) 10 🟢 13 🔴
Errors 0.02 (+0.02) - 1 🔴
Llm_errors 0.01 (+0.01) - 1 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 24238.32tok (-2239.16tok) 13 🟢 13 🔴
Prompt_cached_tokens 8144.92tok (-1759.63tok) 10 🟢 11 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 588.6tok (-27.8tok) 12 🟢 17 🔴
Completion_reasoning_tokens 97.71tok (-7.39tok) 14 🟢 13 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 24826.92tok (-2266.97tok) 13 🟢 16 🔴
Estimated_cost 0$ (0$) 14 🟢 14 🔴
Duration 16.55s (+0.42s) 13 🟢 16 🔴
Llm_duration 9.75s (-0.44s) 15 🟢 14 🔴

awaseem pushed a commit that referenced this pull request Jun 22, 2026
…46424) (#47106)

Follow-up to #47077, extracted from the TanStack Start migration
(#46424).

Three `waitForResponse` waits in `database.spec.ts` were registered
*after* their triggering action, so the response could resolve before
the listener attached and the wait would time out (this surfaced under
TanStack, where the data is SSR-streamed, but the waits are redundant on
Next too).

**Removed:**
- Schema Visualizer *actions*:
`waitForSchemaVisualizerToLoad(...'auth')` registered after the
schema-selector click — the `focusTableInVisualizer` loop immediately
below already auto-waits for the auth schema's tables.
- table update / duplicate: `waitForDatabaseToLoad(...)` after the save
mutation — the `toBeVisible` assertion right after each already waits
for the list to refetch.
- the now-unused `waitForDatabaseToLoad` /
`waitForSchemaVisualizerToLoad` imports.

The UI assertions are the real synchronization points, so behaviour is
unchanged on Next.

## To test
- Studio E2E `database.spec.ts` passes (the Schema Visualizer + Tables
groups).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Tests**
* Improved database e2e test reliability by optimizing synchronization
logic and eliminating timing-sensitive helpers that could introduce
flakiness during schema and table operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Alaister Young <[email protected]>
matlin pushed a commit that referenced this pull request Jun 22, 2026
Pulls the framework-agnostic E2E test fixes out of the TanStack Start
migration PR (#46424) so they can land on `master` independently and
scope that PR down. Test files only — no app/source changes.

> [!NOTE]
> **These changes originate from #46424** (the Next.js → TanStack Start
migration). They were made while getting the E2E suite green on both
builds, but they're pure test-file changes that are framework-agnostic
and already pass on the current Next.js build. A few are *also* written
to tolerate TanStack behaviour (called out in code comments) — harmless
and correct on Next today.

**Changed:**
- `realtime-inspector.spec.ts` — drop the racy
`waitForResponse(/settings/)` (the "Join a channel" UI assertion already
gates on settings loading); click the message row's timestamp instead of
its center, which the wide untruncated-JSON cell pushes under the
always-present detail panel.
- `database.spec.ts` — gate the three Schema Visualizer / Tables tests
on the visualizer UI (`focusTableInVisualizer` already auto-waits for
the schema, including the freshly-created table) instead of the `pg-meta
… public-infinite_tables` XHR.
- `database-webhooks.spec.ts` — wait on the `Database Webhooks` heading
instead of marketing copy that was removed when the page moved to the
new integrations UI.
- `queue-integration.spec.ts` — wait on the unconditional "Create queue"
button instead of the grid (which only renders once a queue exists);
assert creation by polling for either valid end-state.

## To test

- Run the affected specs against a local self-hosted studio and confirm
they pass:
`pnpm --prefix e2e/studio run e2e -- features/realtime-inspector.spec.ts
features/database.spec.ts features/database-webhooks.spec.ts
features/queue-integration.spec.ts`
- Or just let the studio E2E suite run on this PR (Next.js build).

Co-authored-by: Alaister Young <[email protected]>
matlin pushed a commit that referenced this pull request Jun 22, 2026
…46424) (#47106)

Follow-up to #47077, extracted from the TanStack Start migration
(#46424).

Three `waitForResponse` waits in `database.spec.ts` were registered
*after* their triggering action, so the response could resolve before
the listener attached and the wait would time out (this surfaced under
TanStack, where the data is SSR-streamed, but the waits are redundant on
Next too).

**Removed:**
- Schema Visualizer *actions*:
`waitForSchemaVisualizerToLoad(...'auth')` registered after the
schema-selector click — the `focusTableInVisualizer` loop immediately
below already auto-waits for the auth schema's tables.
- table update / duplicate: `waitForDatabaseToLoad(...)` after the save
mutation — the `toBeVisible` assertion right after each already waits
for the list to refetch.
- the now-unused `waitForDatabaseToLoad` /
`waitForSchemaVisualizerToLoad` imports.

The UI assertions are the real synchronization points, so behaviour is
unchanged on Next.

## To test
- Studio E2E `database.spec.ts` passes (the Schema Visualizer + Tables
groups).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Tests**
* Improved database e2e test reliability by optimizing synchronization
logic and eliminating timing-sensitive helpers that could introduce
flakiness during schema and table operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Alaister Young <[email protected]>
@alaister alaister mentioned this pull request Jul 10, 2026
6 tasks
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.

2 participants