Skip to content

feat(e2e): background reporter for worker timeline - #8702

Draft
sid-bruno wants to merge 5 commits into
usebruno:mainfrom
sid-bruno:feat/isolated-page-userdata-fixture
Draft

sid-bruno wants to merge 5 commits into
usebruno:mainfrom
sid-bruno:feat/isolated-page-userdata-fixture

Conversation

@sid-bruno

@sid-bruno sid-bruno commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Description

A simple reporter to add the history of tests that were run by a worker in a clean format so that we can find which test contaminates the failing tests.

Additionally fixes a lot of the e2e tests to have better locators and more defined checks for parallel runs

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

Summary by CodeRabbit

  • Testing & Diagnostics

    • Added worker-timeline reporting with per-worker execution order plus failure “predecessor” breakdowns and debug command output.
    • Introduced a timeline-driven contaminator bisect/auto-debug CLI to identify and confirm flake contaminators.
    • Improved Electron boot/wait timing and overall UI synchronization/timeouts to reduce Playwright instability.
  • Bug Fixes

    • Shortened the shell-environment refresh timeout during proxy re-sync to avoid long stalls.
  • New Features

    • Added a /many-headers test endpoint that returns 80 custom headers.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b48b9ecd-8303-4cb1-aead-fc114fc06e7e

📥 Commits

Reviewing files that changed from the base of the PR and between 5d793b5 and 4336176.

📒 Files selected for processing (5)
  • playwright.config.ts
  • tests/apps/apps-ui.spec.ts
  • tests/collection/open/open-multiple-collections.spec.ts
  • tests/request/generate-code/send-vs-snippet.spec.ts
  • tests/utils/page/actions.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/apps/apps-ui.spec.ts
  • tests/request/generate-code/send-vs-snippet.spec.ts
  • playwright.config.ts
  • tests/utils/page/actions.ts

Walkthrough

Playwright now records worker timelines and failure predecessors, provides a contaminator-bisection CLI, improves Electron fixture timing and isolation, and hardens proxy behavior and asynchronous UI tests.

Changes

Playwright diagnostics

Layer / File(s) Summary
Worker timeline reporting
playwright/reporters/worker-timeline.js, playwright.config.ts
A configured reporter records worker test attempts and generates timeline, predecessor, and debugging artifacts.
Contaminator isolation CLI
scripts/find-e2e-contaminator.js, .gitignore
The CLI loads failures, runs ordered sequences, bisects candidates, confirms results, and supports multi-victim debugging.
Shared-worker diagnosis guidance
.claude/rules/testing.md
Testing guidance documents shared Electron state and the artifact-driven diagnosis workflow.

Electron and test reliability

Layer / File(s) Summary
Electron fixture timing and isolation
playwright/index.ts, playwright.config.ts
Boot, fixture, expectation, restart, and user-data timeout behavior is standardized.
Proxy and test service behavior
packages/bruno-electron/src/store/*, packages/bruno-tests/src/echo/index.js
Proxy refresh uses a five-second timeout, with updated coverage and an 80-header echo route.
Shared page helpers and UI tests
tests/utils/page/*, tests/*
Shared helpers and affected tests add scoped locators, polling, explicit waits, resilient save flows, and persistence synchronization.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • usebruno/bruno#7159: Related Electron and Playwright fixture orchestration in playwright/index.ts.
  • usebruno/bruno#7941: Related Electron readiness, timeout, and restart handling in playwright/index.ts.

Suggested reviewers: helloanoop

Poem

Worker trails glow bright,
Bisectors chase the flake,
Electron waits its turn,
While tests learn to awake,
Stable paths emerge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a worker-timeline background reporter for e2e debugging.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@sid-bruno sid-bruno changed the title feat(e2e): isolated page userdata fixture addition and relevant tests feat(e2e): isolated page userdata fixture addition to relevant tests Jul 21, 2026
@sid-bruno
sid-bruno marked this pull request as ready for review July 22, 2026 07:35
Copilot AI review requested due to automatic review settings July 22, 2026 07:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new Playwright/Electron test fixture (isolatedPage) that launches Bruno with a fresh userData directory per test, and updates a broad set of E2E specs to opt into this isolation to reduce flaky cross-test state leakage.

Changes:

  • Added isolatedPage fixture to playwright/index.ts to launch/trace/close a per-test Electron app with a fresh temp profile.
  • Updated many existing E2E specs to use { isolatedPage: page } instead of the worker-shared page.
  • Updated internal testing guidance docs to document the new fixture and when to use it.

Reviewed changes

Copilot reviewed 96 out of 96 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tests/websockets/ws-header.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/websockets/message-header.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/websockets/message-body-default.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/websockets/expanded-persistence.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/variable-tooltip/variable-tooltip.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/variable-datatypes/import.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/variable-datatypes/create-via-ui.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/transient-requests/transient-file-mode-save.spec.ts Switched suite to use isolatedPage for per-test profile isolation.
tests/start/app-open.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/sidebar/section-auto-expand.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/sidebar/rename-collection-item.spec.ts Switched suite to use isolatedPage for per-test profile isolation.
tests/response/response-clearing.spec.ts Switched suite to use isolatedPage for per-test profile isolation.
tests/response/response-actions.spec.ts Switched tests to use isolatedPage (and added an afterAll cleanup using it).
tests/response/large-response-crash-prevention.spec.ts Switched tests to use isolatedPage (and added an afterAll cleanup using it).
tests/request/timeline/timeline-url-update.spec.ts Switched tests to use isolatedPage (and added an afterAll cleanup using it).
tests/request/timeline/timeline-scoped-request-attribution.spec.ts Switched suite to use isolatedPage for per-test profile isolation.
tests/request/timeline/timeline-runrequest-skip.spec.ts Switched suite to use isolatedPage for per-test profile isolation.
tests/request/timeline/timeline-runrequest-network-error.spec.ts Switched suite to use isolatedPage for per-test profile isolation.
tests/request/timeline/timeline-nested-runrequest.spec.ts Switched suite to use isolatedPage for per-test profile isolation.
tests/request/save/save.spec.ts Switched test to use isolatedPage (and changed a beforeAll to use it).
tests/request/headers/auto-append-empty-header-row.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/request/delete-request/delete-request-sequence-updation.spec.ts Switched test to use isolatedPage (and added an afterAll cleanup using it).
tests/request/body-scroll/body-scroll-restoration.spec.ts Switched suite to use isolatedPage for per-test profile isolation.
tests/request/binary-file/binary-file-selection-switch.spec.ts Changed suite cleanup hook to use isolatedPage (test still uses shared page).
tests/preferences/tab-switch-persistence/tab-switch-persistence.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/preferences/system-proxy-timestamp.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/preferences/autosave/autosave.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/import/wsdl/import-wsdl.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/import/url-import/postman-url-import.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/url-import/openapi-url-import.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/import/url-import/insomnia-url-import.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/url-import/github-repository-import.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/malformed-structure.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/invalid-schema.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/invalid-missing-info.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/invalid-json.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/import-postman-v21.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/import-postman-v21-wrapped.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/import-postman-v20.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/import-partial-collection.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/import/postman/import-many-issues-collection.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/postman/import-file-format-options.spec.ts Switched test to use isolatedPage (and added an afterAll cleanup using it).
tests/import/openapi/security-schemes-import.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/import/openapi/path-based-grouping.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/openapi/operation-name-with-newlines-fix.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/openapi/missing-info.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/openapi/malformed-yaml.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/openapi/import-openapi-yaml.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/openapi/import-openapi-json.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/openapi/duplicate-operation-names-fix.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/insomnia/malformed-structure.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/insomnia/invalid-missing-collection.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/insomnia/import-insomnia-v5.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/insomnia/import-insomnia-v5-environments.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/insomnia/import-insomnia-v5-date-types.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/insomnia/import-insomnia-v4.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/insomnia/import-insomnia-v4-environments.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/file-types/invalid-file-handling.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/file-types/file-input-acceptance.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/bulk-import/yml-as-default-file-format.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/bulk-import/004-select-all.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/bulk-import/003-selection-list-viewport.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/bulk-import/002-all-collection-types.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/bulk-import/001-multiple-files-upload.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/bruno/import-bruno-with-examples.spec.ts Switched test to use isolatedPage (and added an afterAll cleanup using it).
tests/import/bruno/import-bruno-testbench.spec.ts Switched test to use isolatedPage (and added an afterAll cleanup using it).
tests/import/bruno/import-bruno-request-missing-url.spec.ts Switched tests to use isolatedPage (and added an afterAll cleanup using it).
tests/import/bruno/import-bruno-missing-required-schema.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/bruno/import-bruno-JSON-v2.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/import/bruno/import-bruno-descriptions.spec.ts Switched suites to use isolatedPage for per-test profile isolation.
tests/import/bruno/import-bruno-corrupted-fails.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/grpc/multi-message-yml/multi-message.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/graphql/docs-explorer/docs-explorer.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/environments/save-shortcut/save-shortcut.spec.ts Switched suites to use isolatedPage for per-test profile isolation.
tests/environments/focus-retention/environment-focus.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/environments/create-environment/global-env-create.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/environments/create-environment/collection-env-create.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/editable-table/editable-table.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/dotenv/special-chars-collection-path/dotenv-special-chars.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/devtools/performance/performance-tab.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/collection/presets-indicator.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/collection/moving-tabs/move-tabs.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/collection/moving-requests/tag-persistence.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/collection/moving-requests/cross-collection-drag-drop-folder.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/collection/folder-docs-sticky/folder-docs-sticky.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/collection/draft/draft-values-in-requests.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/collection/delete/delete-collection.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/collection/default-sandbox-mode/default-sandbox-mode.spec.ts Switched test to use isolatedPage for per-test profile isolation.
tests/collection/create/create-collection.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
tests/codeeditor-state/fold-persistence.spec.ts Switched suites to use isolatedPage for per-test profile isolation.
tests/apps/apps-ui.spec.ts Switched tests to use isolatedPage for per-test profile isolation.
playwright/index.ts Added isolatedPage fixture (fresh temp userData per test) and updated fixture typings/docs.
.claude/skills/write-e2e-test/SKILL.md Documented isolatedPage in E2E authoring guidance.
.claude/rules/testing.md Added isolatedPage to the fixtures reference table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/response/response-actions.spec.ts Resolved
Comment thread tests/request/save/save.spec.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/write-e2e-test/SKILL.md:
- Around line 34-41: Clarify the `page` fixture description in the fixture list:
state that the default `page` uses the worker-shared Electron app/profile, while
distinguishing it from the test-scoped page object. Replace the claim that
existing `page` fixtures are worker-shared, and retain the guidance to use
`isolatedPage` when tests must avoid shared worker state.

In `@playwright/index.ts`:
- Around line 351-360: Wrap the isolatedPage fixture’s app setup and use flow in
a try/finally block so closeElectronApp(app) always runs after launchElectronApp
succeeds, including when app.context(), waitForReadyPage(app), or
usePageWithTracing throws.

In `@tests/environments/import-environment/collection-env-import.spec.ts`:
- Line 6: Remove the test-scoped isolatedPage parameter and associated afterAll
cleanup hooks in
tests/environments/import-environment/collection-env-import.spec.ts (lines 6-6),
tests/import/bruno/import-bruno-request-missing-url.spec.ts (lines 6-6),
tests/import/bruno/import-bruno-testbench.spec.ts (lines 6-6), and
tests/import/bruno/import-bruno-with-examples.spec.ts (lines 6-6); if cleanup is
still required, move it to afterEach using the appropriate test-scoped fixture.

In `@tests/import/postman/import-file-format-options.spec.ts`:
- Around line 7-9: Update the teardown around closeAllCollections so
test.afterAll no longer requests the test-scoped isolatedPage fixture. Move this
cleanup to test.afterEach if it is still required, or remove it when
isolatedPage teardown already provides the necessary cleanup.

In `@tests/request/binary-file/binary-file-selection-switch.spec.ts`:
- Line 36: Update the suite cleanup hook around test.afterAll to stop requesting
the test-scoped isolatedPage fixture; move the cleanup to test.afterEach so each
test can receive isolatedPage, or use a worker-scoped fixture only if the
cleanup must remain suite-level.

In `@tests/request/delete-request/delete-request-sequence-updation.spec.ts`:
- Around line 5-7: Replace the afterAll hook using the per-test isolatedPage
fixture with afterEach, or remove the cleanup if it is unnecessary, in
closeAllCollections cleanup for delete-request sequence updation. In
tests/request/save/save.spec.ts lines 26-28, replace the beforeAll hook using
isolatedPage with beforeEach, or inline the setup in the test; both sites must
use isolatedPage only within test-scoped hooks.

In `@tests/request/timeline/timeline-url-update.spec.ts`:
- Around line 33-35: Replace the worker-level afterAll cleanup that destructures
isolatedPage with afterEach cleanup or remove it if fixture teardown already
closes the app. Apply this to
tests/request/timeline/timeline-url-update.spec.ts:33-35,
tests/response/large-response-crash-prevention.spec.ts:9-12, and
tests/response/response-actions.spec.ts:13-15, preserving closeAllCollections
cleanup without resolving the test-scoped fixture from afterAll.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c14af63e-8904-4836-92c2-d4c0be8d59f2

📥 Commits

Reviewing files that changed from the base of the PR and between eaf62ee and 78f4aa4.

📒 Files selected for processing (96)
  • .claude/rules/testing.md
  • .claude/skills/write-e2e-test/SKILL.md
  • playwright/index.ts
  • tests/apps/apps-ui.spec.ts
  • tests/codeeditor-state/fold-persistence.spec.ts
  • tests/collection/create/create-collection.spec.ts
  • tests/collection/default-sandbox-mode/default-sandbox-mode.spec.ts
  • tests/collection/delete/delete-collection.spec.ts
  • tests/collection/draft/draft-values-in-requests.spec.ts
  • tests/collection/folder-docs-sticky/folder-docs-sticky.spec.ts
  • tests/collection/moving-requests/cross-collection-drag-drop-folder.spec.ts
  • tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts
  • tests/collection/moving-requests/tag-persistence.spec.ts
  • tests/collection/moving-tabs/move-tabs.spec.ts
  • tests/collection/presets-indicator.spec.ts
  • tests/devtools/performance/performance-tab.spec.ts
  • tests/dotenv/special-chars-collection-path/dotenv-special-chars.spec.ts
  • tests/editable-table/editable-table.spec.ts
  • tests/environments/create-environment/collection-env-create.spec.ts
  • tests/environments/create-environment/global-env-create.spec.ts
  • tests/environments/focus-retention/environment-focus.spec.ts
  • tests/environments/import-environment/collection-env-import.spec.ts
  • tests/environments/save-shortcut/save-shortcut.spec.ts
  • tests/graphql/docs-explorer/docs-explorer.spec.ts
  • tests/grpc/multi-message-yml/multi-message.spec.ts
  • tests/import/bruno/import-bruno-JSON-v2.spec.ts
  • tests/import/bruno/import-bruno-corrupted-fails.spec.ts
  • tests/import/bruno/import-bruno-descriptions.spec.ts
  • tests/import/bruno/import-bruno-missing-required-schema.spec.ts
  • tests/import/bruno/import-bruno-request-missing-url.spec.ts
  • tests/import/bruno/import-bruno-testbench.spec.ts
  • tests/import/bruno/import-bruno-with-examples.spec.ts
  • tests/import/bulk-import/001-multiple-files-upload.spec.ts
  • tests/import/bulk-import/002-all-collection-types.spec.ts
  • tests/import/bulk-import/003-selection-list-viewport.spec.ts
  • tests/import/bulk-import/004-select-all.spec.ts
  • tests/import/bulk-import/yml-as-default-file-format.spec.ts
  • tests/import/file-types/file-input-acceptance.spec.ts
  • tests/import/file-types/invalid-file-handling.spec.ts
  • tests/import/insomnia/import-insomnia-v4-environments.spec.ts
  • tests/import/insomnia/import-insomnia-v4.spec.ts
  • tests/import/insomnia/import-insomnia-v5-date-types.spec.ts
  • tests/import/insomnia/import-insomnia-v5-environments.spec.ts
  • tests/import/insomnia/import-insomnia-v5.spec.ts
  • tests/import/insomnia/invalid-missing-collection.spec.ts
  • tests/import/insomnia/malformed-structure.spec.ts
  • tests/import/openapi/duplicate-operation-names-fix.spec.ts
  • tests/import/openapi/import-openapi-json.spec.ts
  • tests/import/openapi/import-openapi-yaml.spec.ts
  • tests/import/openapi/malformed-yaml.spec.ts
  • tests/import/openapi/missing-info.spec.ts
  • tests/import/openapi/operation-name-with-newlines-fix.spec.ts
  • tests/import/openapi/path-based-grouping.spec.ts
  • tests/import/openapi/security-schemes-import.spec.ts
  • tests/import/postman/import-file-format-options.spec.ts
  • tests/import/postman/import-many-issues-collection.spec.ts
  • tests/import/postman/import-partial-collection.spec.ts
  • tests/import/postman/import-postman-v20.spec.ts
  • tests/import/postman/import-postman-v21-wrapped.spec.ts
  • tests/import/postman/import-postman-v21.spec.ts
  • tests/import/postman/invalid-json.spec.ts
  • tests/import/postman/invalid-missing-info.spec.ts
  • tests/import/postman/invalid-schema.spec.ts
  • tests/import/postman/malformed-structure.spec.ts
  • tests/import/url-import/github-repository-import.spec.ts
  • tests/import/url-import/insomnia-url-import.spec.ts
  • tests/import/url-import/openapi-url-import.spec.ts
  • tests/import/url-import/postman-url-import.spec.ts
  • tests/import/wsdl/import-wsdl.spec.ts
  • tests/preferences/autosave/autosave.spec.ts
  • tests/preferences/system-proxy-timestamp.spec.ts
  • tests/preferences/tab-switch-persistence/tab-switch-persistence.spec.ts
  • tests/request/binary-file/binary-file-selection-switch.spec.ts
  • tests/request/body-scroll/body-scroll-restoration.spec.ts
  • tests/request/delete-request/delete-request-sequence-updation.spec.ts
  • tests/request/headers/auto-append-empty-header-row.spec.ts
  • tests/request/save/save.spec.ts
  • tests/request/timeline/timeline-nested-runrequest.spec.ts
  • tests/request/timeline/timeline-runrequest-network-error.spec.ts
  • tests/request/timeline/timeline-runrequest-skip.spec.ts
  • tests/request/timeline/timeline-scoped-request-attribution.spec.ts
  • tests/request/timeline/timeline-url-update.spec.ts
  • tests/response/large-response-crash-prevention.spec.ts
  • tests/response/response-actions.spec.ts
  • tests/response/response-clearing.spec.ts
  • tests/sidebar/rename-collection-item.spec.ts
  • tests/sidebar/section-auto-expand.spec.ts
  • tests/start/app-open.spec.ts
  • tests/transient-requests/transient-file-mode-save.spec.ts
  • tests/variable-datatypes/create-via-ui.spec.ts
  • tests/variable-datatypes/import.spec.ts
  • tests/variable-tooltip/variable-tooltip.spec.ts
  • tests/websockets/expanded-persistence.spec.ts
  • tests/websockets/message-body-default.spec.ts
  • tests/websockets/message-header.spec.ts
  • tests/websockets/ws-header.spec.ts

Comment thread .claude/skills/write-e2e-test/SKILL.md Resolved
Comment thread playwright/index.ts Resolved
@sid-bruno sid-bruno changed the title feat(e2e): isolated page userdata fixture addition to relevant tests feat(e2e): background reporter for worker timeline Jul 22, 2026
@sid-bruno
sid-bruno force-pushed the feat/isolated-page-userdata-fixture branch from 78f4aa4 to 1d8d063 Compare July 22, 2026 09:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/find-e2e-contaminator.js`:
- Around line 100-113: Update runPlaywright so spawnSync never invokes a shell,
including on Windows; remove the platform-dependent shell option while
preserving the existing argument-array invocation and grep handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ccc0f18f-c444-48e2-a714-2893aeee4868

📥 Commits

Reviewing files that changed from the base of the PR and between 78f4aa4 and 1d8d063.

📒 Files selected for processing (4)
  • .claude/rules/testing.md
  • playwright.config.ts
  • playwright/reporters/worker-timeline.js
  • scripts/find-e2e-contaminator.js

Comment thread scripts/find-e2e-contaminator.js Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
playwright/index.ts (2)

1-1: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Fixture timeouts for newPage and pageWithUserData don't scale for their dual-phase launch+wait operations.

Both fixtures perform a bounded launch (up to ELECTRON_BOOT_TIMEOUT_MS) followed by a bounded waitForReadyPage (up to ELECTRON_BOOT_TIMEOUT_MS+ internal sequential waits), yet each is capped by a single ELECTRON_BOOT_TIMEOUT_MS fixture timeout — unlike restartApp, which explicitly uses ELECTRON_BOOT_TIMEOUT_MS * 2 for its comparable close+relaunch dual-phase work (Line 428). The mismatch risks the outer Playwright fixture timeout firing before the more specific inner timeouts resolve, producing less diagnosable failures under slow boot.

  • playwright/index.ts#L341-357: bump newPage's fixture timeout to ELECTRON_BOOT_TIMEOUT_MS * 2 to match its launch+ready-wait budget.
  • playwright/index.ts#L431-461: bump pageWithUserData's fixture timeout to ELECTRON_BOOT_TIMEOUT_MS * 2 for the same reason.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@playwright/index.ts` at line 1, Update the fixture timeout configurations for
newPage and pageWithUserData to use ELECTRON_BOOT_TIMEOUT_MS * 2, matching their
launch and readiness-wait phases and the existing restartApp configuration;
leave the fixture behavior otherwise unchanged.

431-461: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Same tight timeout-budget issue as newPage.

pageWithUserData also chains reuseOrLaunchElectronApp (up to 18s) and waitForReadyPage (up to 18s+) under a single ELECTRON_BOOT_TIMEOUT_MS fixture timeout, unlike restartApp's 2x budget for its comparable dual-phase operation.

🔧 Proposed fix
       const app = await reuseOrLaunchElectronApp({ initUserDataPath: tmpAppDataDir, testFile: testInfo.file, templateVars });

       const context = await app.context();
       const page = await waitForReadyPage(app);
       await usePageWithTracing(context, page, testInfo, use, { initTracing: true });
     },
-    { timeout: ELECTRON_BOOT_TIMEOUT_MS }
+    { timeout: ELECTRON_BOOT_TIMEOUT_MS * 2 }
   ]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@playwright/index.ts` around lines 431 - 461, Increase the fixture timeout for
pageWithUserData to cover both reuseOrLaunchElectronApp and waitForReadyPage,
matching the doubled timeout budget used by restartApp. Keep the existing
initialization, context setup, tracing, and page usage flow unchanged.
🧹 Nitpick comments (5)
tests/cookies/corrupted-passkey.spec.ts (1)

18-19: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Centralize the Cookies modal locator. Both launches duplicate a raw modal selector instead of using the shared page-locator layer.

  • tests/cookies/corrupted-passkey.spec.ts#L18-L19: obtain the first-run Cookies modal through a shared locator.
  • tests/cookies/corrupted-passkey.spec.ts#L62-L65: use that same shared locator for the second-run modal.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/cookies/corrupted-passkey.spec.ts` around lines 18 - 19, The Cookies
modal locator is duplicated with a raw selector in both launches. In
tests/cookies/corrupted-passkey.spec.ts lines 18-19 and 62-65, update the
first-run and second-run modal lookups to use the shared page-locator layer,
reusing the same locator for both sites.

Source: Path instructions

tests/environments/global-env-draft-merge-with-script/global-env-draft-merge-with-script.spec.ts (1)

19-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid mutating CodeMirror internals from the spec.

This bypasses the user input path, so the test can pass if editing through the UI regresses. Move the edit into a shared page action that drives the supported editor interaction. As per path instructions, E2E tests must verify behavior through real user actions and centralize actions under tests/utils/page/*.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@tests/environments/global-env-draft-merge-with-script/global-env-draft-merge-with-script.spec.ts`
around lines 19 - 28, Replace the direct CodeMirror access in the test with a
shared page action under tests/utils/page/* that edits the environment variable
through supported user interactions. Update the spec to call that action for
existingVar, preserving the expected draft-edited-global-value assertion and
avoiding CodeMirror internals.

Source: Path instructions

tests/grpc/method-search/grpc-method-search.spec.ts (1)

3-12: 📐 Maintainability & Code Quality | 🔵 Trivial

Move the shared gRPC refresh flow into the page-action layer.

This is reusable UI synchronization logic; placing it in tests/utils/page/* keeps specs declarative and prevents future selector duplication. As per path instructions, centralize locators and actions in page modules.

[low_effort_and-high_reward]

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/grpc/method-search/grpc-method-search.spec.ts` around lines 3 - 12,
Move the refresh-and-open workflow from the test spec’s refreshAndOpenMethods
helper into the appropriate page-action module under tests/utils/page.
Centralize the refresh icon, reflection-loaded status, methods dropdown, and
methods list locators and interactions there, then update the spec to call the
page-layer action while preserving the existing wait and visibility behavior.

Source: Path instructions

tests/protobuf/manage-protofile.spec.ts (1)

62-63: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Centralize the new backdrop locator.

The added page.locator('.bruno-modal-backdrop') calls embed a raw selector in the spec. Add a page helper or locator under tests/utils/page/* and use it here to prevent selector drift.

As per path instructions, locators and actions must be centralized in tests/utils/page/*.

Also applies to: 72-72

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/protobuf/manage-protofile.spec.ts` around lines 62 - 63, Centralize the
.bruno-modal-backdrop selector in a page helper or locator under
tests/utils/page, then update the backdrop assertions around the affected lines
in manage-protofile.spec.ts to use that shared symbol instead of
page.locator('.bruno-modal-backdrop').

Source: Path instructions

tests/request/description/write-request-body-file-description.spec.ts (1)

35-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the save-result assertion in the spec.

saveRequest(page) currently performs the expect(...) assertion inside tests/utils/page/actions.ts. Split the action and wait, or return the save signal so this spec explicitly asserts the required save outcome.

As per path instructions, action helpers should synchronize or wait while expect(...) assertions remain in specs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/request/description/write-request-body-file-description.spec.ts` at
line 35, Update saveRequest in the page action helpers to perform only the save
action and synchronization, or return a save completion signal, without
containing the expect assertion; then update the spec around saveRequest to
explicitly assert the required save outcome.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@playwright/index.ts`:
- Around line 349-357: Update the newPage fixture’s launchElectronApp flow to
guarantee closeElectronApp is invoked when app.context(), waitForReadyPage(), or
usePageWithTracing() fails, while preserving normal page usage and existing
timeout behavior. Use the existing app and closeElectronApp lifecycle symbols
rather than relying solely on worker-level teardown.
- Around line 341-357: Update the newPage fixture timeout to budget for both
sequential bounded operations, launchElectronApp() and waitForReadyPage(app), by
using the same doubled timeout strategy as the analogous restartApp fixture.
Leave the fixture body and tracing options unchanged.

In `@scripts/find-e2e-contaminator.js`:
- Around line 202-205: Fix the manual --victim file:line path so it does not
fail the title validation in materializeOrderedSequence. Update parseLocator and
the related ordered-sequence matching flow to derive the locator’s title or
match the specified file and line directly, while preserving title-based
matching for titled locators; keep the documented file:line usage functional.
- Around line 224-231: Update the import-rewriting logic in the contaminator
step-processing flow before fs.writeFileSync to handle all relative specifiers,
including ../pac/server, ./server, and ./helpers, rather than only Playwright
and utils paths. Normalize supported relative imports to valid materialized-spec
paths, or reject unsupported copied specs before writing them; keep stepFiles
and grepParts updates after successful validation.

In `@tests/cookies/cookie-persistence.spec.ts`:
- Around line 30-32: Replace the fixed page1.waitForTimeout(500) delay in the
cookie persistence test with an expect.poll check that reads
userDataPath/cookies.json and verifies example.com is persisted. Ensure this
persistence assertion completes before closeElectronApp(app1) is called, while
retaining the existing visibility assertion.

In `@tests/preferences/system-proxy-timestamp.spec.ts`:
- Around line 53-63: Update the polling assertion around
systemProxyLastRefreshedLabel to require the data-refreshed-at attribute to be
present and parse to a finite number before comparing it with firstRefreshedAt.
Ensure null, invalid, and non-finite values keep polling, while a valid
timestamp must differ from the initial value.

In `@tests/preferences/tab-switch-persistence/tab-switch-persistence.spec.ts`:
- Around line 123-124: Replace the fixed 600ms delay in the tab-switch
persistence test with an observable wait for the preference store’s
persisted-state signal or a helper that resolves after the preference write
completes. Use an auto-retrying locator expectation where applicable, and ensure
the tab is closed only after persistence is confirmed.

In `@tests/request/generate-code/send-vs-snippet.spec.ts`:
- Around line 55-67: Update expectEchoResponded to accept an
expectedUrlSubstring for the current send and require the preview URL assertion
to include it, preventing stale response text from satisfying later polls. Pass
the path expected by each send to expectEchoResponded(page,
expectedUrlSubstring), or alternatively wait for the response loading/completion
transition before asserting.

---

Outside diff comments:
In `@playwright/index.ts`:
- Line 1: Update the fixture timeout configurations for newPage and
pageWithUserData to use ELECTRON_BOOT_TIMEOUT_MS * 2, matching their launch and
readiness-wait phases and the existing restartApp configuration; leave the
fixture behavior otherwise unchanged.
- Around line 431-461: Increase the fixture timeout for pageWithUserData to
cover both reuseOrLaunchElectronApp and waitForReadyPage, matching the doubled
timeout budget used by restartApp. Keep the existing initialization, context
setup, tracing, and page usage flow unchanged.

---

Nitpick comments:
In `@tests/cookies/corrupted-passkey.spec.ts`:
- Around line 18-19: The Cookies modal locator is duplicated with a raw selector
in both launches. In tests/cookies/corrupted-passkey.spec.ts lines 18-19 and
62-65, update the first-run and second-run modal lookups to use the shared
page-locator layer, reusing the same locator for both sites.

In
`@tests/environments/global-env-draft-merge-with-script/global-env-draft-merge-with-script.spec.ts`:
- Around line 19-28: Replace the direct CodeMirror access in the test with a
shared page action under tests/utils/page/* that edits the environment variable
through supported user interactions. Update the spec to call that action for
existingVar, preserving the expected draft-edited-global-value assertion and
avoiding CodeMirror internals.

In `@tests/grpc/method-search/grpc-method-search.spec.ts`:
- Around line 3-12: Move the refresh-and-open workflow from the test spec’s
refreshAndOpenMethods helper into the appropriate page-action module under
tests/utils/page. Centralize the refresh icon, reflection-loaded status, methods
dropdown, and methods list locators and interactions there, then update the spec
to call the page-layer action while preserving the existing wait and visibility
behavior.

In `@tests/protobuf/manage-protofile.spec.ts`:
- Around line 62-63: Centralize the .bruno-modal-backdrop selector in a page
helper or locator under tests/utils/page, then update the backdrop assertions
around the affected lines in manage-protofile.spec.ts to use that shared symbol
instead of page.locator('.bruno-modal-backdrop').

In `@tests/request/description/write-request-body-file-description.spec.ts`:
- Line 35: Update saveRequest in the page action helpers to perform only the
save action and synchronization, or return a save completion signal, without
containing the expect assertion; then update the spec around saveRequest to
explicitly assert the required save outcome.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5669f6d2-bc26-4aff-9d4d-f2caa2ba1d4c

📥 Commits

Reviewing files that changed from the base of the PR and between 1d8d063 and 5d793b5.

📒 Files selected for processing (36)
  • .claude/rules/testing.md
  • .gitignore
  • packages/bruno-electron/src/store/system-proxy.js
  • packages/bruno-electron/src/store/tests/system-proxy.spec.js
  • packages/bruno-tests/src/echo/index.js
  • playwright.config.ts
  • playwright/index.ts
  • playwright/reporters/worker-timeline.js
  • scripts/find-e2e-contaminator.js
  • tests/apps/apps-ui.spec.ts
  • tests/collection/description-yml/read-collection-description.spec.ts
  • tests/collection/description/read-collection-description.spec.ts
  • tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts
  • tests/collection/moving-requests/tag-persistence.spec.ts
  • tests/collection/open/open-multiple-collections.spec.ts
  • tests/cookies/cookie-persistence.spec.ts
  • tests/cookies/corrupted-passkey.spec.ts
  • tests/environments/api-setEnvVar/api-setEnvVar-with-persist.spec.ts
  • tests/environments/export-environment/collection-env-export/collection-env-export.spec.ts
  • tests/environments/focus-retention/environment-focus.spec.ts
  • tests/environments/global-env-draft-merge-with-script/global-env-draft-merge-with-script.spec.ts
  • tests/environments/save-shortcut/save-shortcut.spec.ts
  • tests/graphql/query-builder/query-builder.spec.ts
  • tests/grpc/method-search/grpc-method-search.spec.ts
  • tests/import/insomnia/import-insomnia-v4-environments.spec.ts
  • tests/preferences/system-proxy-timestamp.spec.ts
  • tests/preferences/tab-switch-persistence/tab-switch-persistence.spec.ts
  • tests/protobuf/manage-protofile.spec.ts
  • tests/request/binary-file/binary-file-upload.spec.ts
  • tests/request/description/write-request-body-file-description.spec.ts
  • tests/request/description/write-request-body-form-urlencoded-description.spec.ts
  • tests/request/description/write-request-body-multipart-description.spec.ts
  • tests/request/generate-code/send-vs-snippet.spec.ts
  • tests/shortcuts/search-actions.spec.ts
  • tests/utils/page/actions.ts
  • tests/utils/page/sidebar/index.ts
💤 Files with no reviewable changes (2)
  • tests/collection/description-yml/read-collection-description.spec.ts
  • tests/collection/description/read-collection-description.spec.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • playwright.config.ts
  • .claude/rules/testing.md
  • playwright/reporters/worker-timeline.js

Comment thread playwright/index.ts Resolved
Comment thread playwright/index.ts Resolved
Comment thread scripts/find-e2e-contaminator.js Resolved
Comment thread scripts/find-e2e-contaminator.js Resolved
@sid-bruno
sid-bruno marked this pull request as ready for review July 24, 2026 11:54

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants