Repository navigation
Feat/playwright os 2 - #7941
Feat/playwright os 2#7941
Conversation
WalkthroughThis PR consolidates CI workflows across Linux/macOS/Windows platforms with configurable shell support, refactors test infrastructure to use a standardized page-readiness helper ( ChangesCI/CD Workflow Platform Consolidation & Shell Configuration
Playwright Test Infrastructure & Page Readiness Standardization
Electron App Shutdown & Async Watcher Cleanup
Test Robustness & Stability Improvements
Minor Updates & Supporting Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
CLI Test Results (Linux) 1 files 211 suites 53s ⏱️ Results for commit f63c1fd. ♻️ This comment has been updated with latest results. |
1581a7b to
811419d
Compare
11d50f8 to
6b739f8
Compare
|
a44b6b5 to
980b20c
Compare
f60f3e4 to
4cb5a0c
Compare
There was a problem hiding this comment.
Actionable comments posted: 11
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
tests/response/response-actions.spec.ts (1)
58-62:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUse event-driven polling for clipboard assertion to prevent race condition.
The clipboard may not be updated immediately after the toast appears. Line 33 of the same file already demonstrates the correct pattern with
expect.poll(). Apply the same approach here: clear the clipboard before copying, then poll until the value equals'cG9uZw=='instead of reading immediately.Suggested fix
await test.step('Copy response and verify clipboard contains Base64', async () => { await clickResponseAction(page, 'response-copy-btn'); await expect(page.getByText('Response copied to clipboard')).toBeVisible({ timeout: 10000 }).catch(() => {}); - - const clipboardText = await page.evaluate(() => navigator.clipboard.readText()); - // "pong" in Base64 is "cG9uZw==" - expect(clipboardText).toBe('cG9uZw=='); + await page.evaluate(() => navigator.clipboard.writeText('')); + await expect.poll( + async () => await page.evaluate(() => navigator.clipboard.readText().catch(() => '')) + ).toBe('cG9uZw=='); });🤖 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/response/response-actions.spec.ts` around lines 58 - 62, The clipboard assertion has a race: instead of immediately calling page.evaluate(() => navigator.clipboard.readText()) after page.getByText('Response copied to clipboard'), clear the clipboard first and replace the direct read with event-driven polling using expect.poll to repeatedly call page.evaluate(() => navigator.clipboard.readText()) until it equals 'cG9uZw=='; locate the clipboard usage around page.getByText and page.evaluate and change it to clear the clipboard prior to the copy action and use expect.poll(() => page.evaluate(...)).toBe('cG9uZw==') to wait for the value.tests/workspace/create-workspace/create-workspace.spec.ts (1)
395-396:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winInconsistent readiness pattern - missed during refactoring.
Lines 395-396 still use the old
app.firstWindow()+[data-app-state="loaded"]pattern, while all other tests in this file usewaitForReadyPage(app).🔧 Align with the rest of the file
- const page = await app.firstWindow(); - await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); + const page = await waitForReadyPage(app);🤖 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/workspace/create-workspace/create-workspace.spec.ts` around lines 395 - 396, The test still uses the old readiness pattern by calling app.firstWindow() and waiting on the '[data-app-state="loaded"]' locator; replace that with the shared helper waitForReadyPage(app) to align with other tests. Locate the occurrence using app.firstWindow() and the locator '[data-app-state="loaded"]' in create-workspace.spec.ts and remove those two lines, then call waitForReadyPage(app) (the existing helper used elsewhere in this file) to ensure consistent readiness handling.
🧹 Nitpick comments (8)
tests/runner/collection-run-report/collection-run-report.spec.ts (1)
23-43: ⚡ Quick winConsider using
test.stepfor better reporting.The test would benefit from wrapping the main actions in
test.stepblocks to improve readability of generated reports. For example:test('CLI: Run collection and generate JUnit report', async ({ createTmpDir }) => { await test.step('Setup output directory', async () => { const outputDir = await createTmpDir('junit-report'); // ... }); await test.step('Execute CLI with JUnit reporter', async () => { // ... }); await test.step('Verify report content', async () => { // ... }); });As per coding guidelines, promoting the use of
test.stepmakes generated reports easier to read.🤖 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/runner/collection-run-report/collection-run-report.spec.ts` around lines 23 - 43, The test 'CLI: Run collection and generate JUnit report' should be split into logical test.step blocks to improve report readability; refactor the body of the test that currently uses createTmpDir, constructs junitOutputPath, runs execSync(command), and asserts via normalizeJunitReport into three await test.step calls (e.g., "Setup output directory", "Execute CLI with JUnit reporter", "Verify report content") so each major action (creating outputDir/junitOutputPath, running execSync, reading/normalizing and snapshotting the report) is wrapped in its own test.step for clearer reporting.tests/import/insomnia/import-insomnia-v5-environments.spec.ts (1)
80-80: 💤 Low valueConsider extracting the timeout value as a constant.
The 15-second timeout appears three times in this file. Extracting it as a named constant (e.g.,
ENV_FLATTEN_TIMEOUT_MS) would make it easier to adjust if CI performance characteristics change.♻️ Optional refactor
+const ENV_FLATTEN_TIMEOUT_MS = 15000; + test.describe('Import Insomnia v5 Collection - Environment Import', () => {Then replace each occurrence:
- await page.locator('input[value="config.debug"]').waitFor({ state: 'visible', timeout: 15000 }); + await page.locator('input[value="config.debug"]').waitFor({ state: 'visible', timeout: ENV_FLATTEN_TIMEOUT_MS });Also applies to: 148-148, 206-206
🤖 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/import/insomnia/import-insomnia-v5-environments.spec.ts` at line 80, Extract the repeated 15000 ms literal into a named constant (e.g., ENV_FLATTEN_TIMEOUT_MS = 15000) at the top of the test file and replace each hard-coded timeout in the three waitFor calls (the one using page.locator('input[value="config.debug"]').waitFor and the other two occurrences referenced in the comment) with that constant; ensure any imports or top-level test-level scope accommodate the new constant so all references compile and maintain original behavior.tests/import/insomnia/import-insomnia-v4-environments.spec.ts (1)
83-83: 💤 Low valueConsider extracting the timeout value as a constant.
The 15-second timeout appears three times in this file. Extracting it as a named constant (e.g.,
ENV_FLATTEN_TIMEOUT_MS) would improve maintainability and allow easy adjustment for CI performance tuning.♻️ Optional refactor
+const ENV_FLATTEN_TIMEOUT_MS = 15000; + test.describe('Import Insomnia v4 Collection - Environment Import', () => {Then replace each occurrence:
- await page.locator('input[value="user.roles[1]"]').waitFor({ state: 'visible', timeout: 15000 }); + await page.locator('input[value="user.roles[1]"]').waitFor({ state: 'visible', timeout: ENV_FLATTEN_TIMEOUT_MS });Also applies to: 137-137, 187-187
🤖 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/import/insomnia/import-insomnia-v4-environments.spec.ts` at line 83, Extract the repeated 15000 timeout into a named constant (e.g., ENV_FLATTEN_TIMEOUT_MS = 15000) at the top of the test file and replace the three literal timeouts used in the locators/waits (the lines using page.locator(...).waitFor({ state: 'visible', timeout: 15000 })) with timeout: ENV_FLATTEN_TIMEOUT_MS so the tests reference the single constant for easier tuning and maintenance.packages/bruno-app/src/components/EnvironmentVariablesTable/index.js (1)
154-168: ⚡ Quick winMemoization dependency is broken—
globalEnvironmentVariablescreates a new object reference every render.The
getGlobalEnvironmentVariables()function (atpackages/bruno-app/src/utils/collections/index.js:1139-1150) creates a fresh object withlet variables = {}on every call, returning a new reference regardless of content. This means theuseMemodependency onglobalEnvironmentVariableschanges every render, causing the memo to re-run and defeating its performance purpose.Fix by depending directly on the source data instead:
const _collection = useMemo(() => { const c = collection ? cloneDeep(collection) : {}; c.globalEnvironmentVariables = globalEnvironmentVariables; if (!collection && workspaceProcessEnvVariables) { c.workspaceProcessEnvVariables = workspaceProcessEnvVariables; } return c; -}, [collection, globalEnvironmentVariables, workspaceProcessEnvVariables]); +}, [collection, globalEnvironments, activeGlobalEnvironmentUid, workspaceProcessEnvVariables]);🤖 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 `@packages/bruno-app/src/components/EnvironmentVariablesTable/index.js` around lines 154 - 168, The memoization is broken because globalEnvironmentVariables is a new object each render; update the _collection useMemo so it does not depend on the computed globalEnvironmentVariables reference—move the call to getGlobalEnvironmentVariables(...) inside the useMemo and change the dependency array to the raw inputs (globalEnvironments and activeGlobalEnvironmentUid) along with collection and workspaceProcessEnvVariables; this ensures _collection only recomputes when collection, globalEnvironments, activeGlobalEnvironmentUid, or workspaceProcessEnvVariables actually change while still setting c.globalEnvironmentVariables from getGlobalEnvironmentVariables(...) inside the memo..github/workflows/tests-windows.yml (1)
10-29: 💤 Low valueTrack the disabled unit tests for Windows.
The unit-test job is currently disabled with
if: falseand includes a TODO comment. While this is a valid pattern for temporarily disabling a job, ensure there's a tracking issue to re-enable these tests once they're fixed.🤖 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 @.github/workflows/tests-windows.yml around lines 10 - 29, The Windows unit-test job ("unit-test") is temporarily disabled via "if: false" with a TODO; create and link a tracking issue for re-enabling Windows unit tests and update the TODO to reference that issue (e.g., include the issue number/URL) so it's easy to find later, and when the issue is resolved remove the "if: false" conditional and the TODO; ensure the job name "unit-test" and the step names ("Setup Node Dependencies", "Run Unit Tests") remain unchanged so the CI workflow resumes correctly once re-enabled.tests/environments/api-setEnvVar/api-setEnvVar-without-persist.spec.ts (1)
23-25: ⚡ Quick winReplace
dispatchEvent('click')withlocator.click()for proper E2E test interaction.Using synthetic
dispatchEventbypasses Playwright's actionability checks (visibility, stability, receiveability). Theclick()method performs full actionability validation and simulates real user interaction, making tests more reliable and aligned with E2E best practices.Suggested changes
await page.locator('#configure-env').waitFor({ state: 'visible' }); - await page.locator('#configure-env').dispatchEvent('click'); + await page.locator('#configure-env').click();Also at line 45:
await newPage.locator('#configure-env').waitFor({ state: 'visible' }); - await newPage.locator('#configure-env').dispatchEvent('click'); + await newPage.locator('#configure-env').click();🤖 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/api-setEnvVar/api-setEnvVar-without-persist.spec.ts` around lines 23 - 25, Replace synthetic dispatchEvent('click') calls on the Playwright locator for '#configure-env' with locator.click() to use Playwright's actionability checks; locate the usages of page.locator('#configure-env').dispatchEvent('click') (there are two occurrences, one near the initial open and another later) and change them to await page.locator('#configure-env').click() so clicks are real user-like interactions and tests become more stable.tests/environments/api-setEnvVar/api-setEnvVar-with-persist.spec.ts (2)
26-27: ⚡ Quick winConsider replacing
dispatchEvent('click')with standard user interaction.E2E tests should verify user-visible behavior. Using
dispatchEvent('click')bypasses the normal event flow and may mask interaction issues like visibility, z-index, or hover state problems.♻️ Suggested approach
Replace the
waitFor+dispatchEventpattern with a standard click, potentially adding aforce: trueoption if the element is intentionally obscured:-await page.locator('#configure-env').waitFor({ state: 'visible' }); -await page.locator('#configure-env').dispatchEvent('click'); +await page.locator('#configure-env').click();If click flakiness persists, investigate the root cause (e.g., hover-dependent visibility, animation timing) rather than working around it.
As per coding guidelines, E2E tests must verify user-visible behaviour, not implementation details.
🤖 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/api-setEnvVar/api-setEnvVar-with-persist.spec.ts` around lines 26 - 27, The test currently uses page.locator('#configure-env').dispatchEvent('click') which bypasses normal user interaction; change it to use the locator's click API (page.locator('#configure-env').click()) so Playwright triggers real user events and visibility checks, and if the element is intentionally covered or flaky add the click option { force: true } only after investigating hover/animation/visibility causes; update any related waits or assertions around the configure-env locator to ensure the click reflects real user-visible behavior.
47-48: ⚡ Quick winConsider replacing
dispatchEvent('click')with standard user interaction.Same concern as the earlier
#configure-envinteraction: usingdispatchEvent('click')bypasses normal user interaction patterns.♻️ Suggested approach
-await newPage.locator('#configure-env').waitFor({ state: 'visible' }); -await newPage.locator('#configure-env').dispatchEvent('click'); +await newPage.locator('#configure-env').click();As per coding guidelines, E2E tests must verify user-visible behaviour, not implementation details.
🤖 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/api-setEnvVar/api-setEnvVar-with-persist.spec.ts` around lines 47 - 48, The test uses newPage.locator('#configure-env').dispatchEvent('click') which bypasses normal user interactions; replace this with a real user action such as awaiting newPage.locator('#configure-env').click() (or await newPage.click('#configure-env')) after the existing waitFor({ state: 'visible' }) so the test exercises user-visible behaviour and events the same way a real user would when invoking the Configure Env button.
🤖 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 @.github/actions/tests/run-cli-tests/action.yml:
- Around line 15-22: The non-Windows job starts the testbench with "npm start
--workspace=packages/bruno-tests &" but doesn’t validate the background process;
update the step that spawns the testbench so it captures the process id (PID)
after starting npm, sleeps briefly, then checks whether that PID is still
running and exits the workflow with an error message if the process has already
terminated; ensure the check happens before running "node
../../bruno-cli/bin/bru.js run ..." so the job fails fast on testbench startup
failures.
In `@packages/bruno-cli/package.json`:
- Line 39: The "test" npm script uses POSIX-only command substitution and which
(the "test" script value) which fails on Windows; change the "test" script so it
invokes the Jest binary by relative path like the existing test:ci script (e.g.,
call node --experimental-vm-modules ../../node_modules/jest/bin/jest.js) instead
of using $(npx which jest) to ensure cross-platform compatibility.
In `@packages/bruno-electron/package.json`:
- Line 24: The "test" script in package.json uses POSIX command substitution
($(npx which jest)) which fails on Windows; update the "test" script to use the
same cross-platform Jest invocation pattern used by the package's "test:ci"
script (and as implemented in bruno-js, bruno-cli, bruno-converters) so it
resolves and runs the local jest binary on all platforms—locate the "test" entry
in package.json and replace the POSIX-only invocation with the proven
cross-platform command used by "test:ci".
In `@tests/environments/import-environment/collection-env-import.spec.ts`:
- Around line 66-67: The test uses a brittle fixed sleep after scrolling the
virtualized table (see page.locator('.table-container').evaluate(...) and
page.waitForTimeout(500)); replace the magic timeout with an event-driven wait
by waiting for an expected row or cell element to appear or become visible (for
example, use the page.locator(...) for a specific row/cell created by the scroll
and call waitFor or waitForElementState/visibility) so the test proceeds only
once the table rows are actually rendered.
In `@tests/environments/import-environment/global-env-import.spec.ts`:
- Around line 61-62: The fixed 500ms sleep after scrolling the virtualized table
should be replaced with an event-driven wait: remove the
page.waitForTimeout(500) and instead wait for a concrete render signal (for
example use variablesTable.locator(...) or page.waitForSelector(...) to wait for
an expected row/cell or a known row identifier to become visible or attached) so
that after await variablesTable.evaluate((el) => el.scrollTop = el.scrollHeight)
the test blocks until the virtualized rows finish rendering (use .waitFor or
.waitForSelector on the specific row/cell text or data attribute).
In
`@tests/preferences/default-collection-location/default-collection-location.spec.js`:
- Around line 4-5: The regex for DEFAULT_LOCATION_SUFFIX_PATTERN is OS-dependent
because it hardcodes '/'; update the pattern construction in
escapeRegExp/DEFAULT_LOCATION_SUFFIX_PATTERN so it accepts both forward and
backslashes (e.g., use a separator character class like [\\/]) or build the
suffix using platform-safe separators (path.sep) and escape it; ensure
escapeRegExp is still used to escape literal parts and that the final RegExp
matches either separator between 'tests/preferences' and
'default-collection-location' when present.
In `@tests/protobuf/manage-protofile.spec.ts`:
- Around line 95-99: Remove the forced click on the close icon: instead of
calling requestTab.getByTestId('request-tab-close-icon').click({ force: true }),
wait for the close icon to be visible/actionable (e.g., await
expect(requestTab.getByTestId('request-tab-close-icon')).toBeVisible() or
toBeEnabled()) and then call click() without the force option; keep the
subsequent Dont Save button checks (page.getByRole('button', { name: 'Don\'t
Save' })) as-is to assert the save dialog and click it normally.
In `@tests/response/response-actions.spec.ts`:
- Around line 30-34: The clipboard assertion is too loose; update the final
expectation in tests/response/response-actions.spec.ts to assert the exact
copied string instead of truthiness: after invoking clickResponseAction(page,
'response-copy-btn') and waiting for the "Response copied to clipboard" toast,
change the expect.poll that reads navigator.clipboard.readText() to assert
.toBe('pong') (ensure the page.evaluate call returns a string fallback like ''
so the assertion is deterministic), so the test verifies the exact clipboard
content copied by the response action.
In `@tests/scratch-requests/scratch-requests.spec.ts`:
- Around line 153-157: Before reading and asserting clipboard contents in the
test that uses page.getByText('Response copied to clipboard') and
page.evaluate(() => navigator.clipboard.readText()), clear the clipboard first
to make the test parallel-safe: use page.evaluate to write an empty string (or
unique sentinel) with navigator.clipboard.writeText('') before triggering the
copy action, then wait for the "Response copied to clipboard" toast and finally
read navigator.clipboard.readText() and assert it equals 'pong'.
In `@tests/shortcuts/bound-actions.spec.ts`:
- Around line 153-157: The assertion using toHaveClass(/active/) on the reqTab
locator can false-match classes like "inactive"; update the assertion in the
test so it checks for a whole-word class (e.g., use a word-boundary regex such
as /\bactive\b/ or an equivalent exact-class check) when verifying reqTab is
active; locate the reqTab variable and the await expect(reqTab).toHaveClass(...)
call and replace the regex accordingly to avoid matching substrings.
---
Outside diff comments:
In `@tests/response/response-actions.spec.ts`:
- Around line 58-62: The clipboard assertion has a race: instead of immediately
calling page.evaluate(() => navigator.clipboard.readText()) after
page.getByText('Response copied to clipboard'), clear the clipboard first and
replace the direct read with event-driven polling using expect.poll to
repeatedly call page.evaluate(() => navigator.clipboard.readText()) until it
equals 'cG9uZw=='; locate the clipboard usage around page.getByText and
page.evaluate and change it to clear the clipboard prior to the copy action and
use expect.poll(() => page.evaluate(...)).toBe('cG9uZw==') to wait for the
value.
In `@tests/workspace/create-workspace/create-workspace.spec.ts`:
- Around line 395-396: The test still uses the old readiness pattern by calling
app.firstWindow() and waiting on the '[data-app-state="loaded"]' locator;
replace that with the shared helper waitForReadyPage(app) to align with other
tests. Locate the occurrence using app.firstWindow() and the locator
'[data-app-state="loaded"]' in create-workspace.spec.ts and remove those two
lines, then call waitForReadyPage(app) (the existing helper used elsewhere in
this file) to ensure consistent readiness handling.
---
Nitpick comments:
In @.github/workflows/tests-windows.yml:
- Around line 10-29: The Windows unit-test job ("unit-test") is temporarily
disabled via "if: false" with a TODO; create and link a tracking issue for
re-enabling Windows unit tests and update the TODO to reference that issue
(e.g., include the issue number/URL) so it's easy to find later, and when the
issue is resolved remove the "if: false" conditional and the TODO; ensure the
job name "unit-test" and the step names ("Setup Node Dependencies", "Run Unit
Tests") remain unchanged so the CI workflow resumes correctly once re-enabled.
In `@packages/bruno-app/src/components/EnvironmentVariablesTable/index.js`:
- Around line 154-168: The memoization is broken because
globalEnvironmentVariables is a new object each render; update the _collection
useMemo so it does not depend on the computed globalEnvironmentVariables
reference—move the call to getGlobalEnvironmentVariables(...) inside the useMemo
and change the dependency array to the raw inputs (globalEnvironments and
activeGlobalEnvironmentUid) along with collection and
workspaceProcessEnvVariables; this ensures _collection only recomputes when
collection, globalEnvironments, activeGlobalEnvironmentUid, or
workspaceProcessEnvVariables actually change while still setting
c.globalEnvironmentVariables from getGlobalEnvironmentVariables(...) inside the
memo.
In `@tests/environments/api-setEnvVar/api-setEnvVar-with-persist.spec.ts`:
- Around line 26-27: The test currently uses
page.locator('#configure-env').dispatchEvent('click') which bypasses normal user
interaction; change it to use the locator's click API
(page.locator('#configure-env').click()) so Playwright triggers real user events
and visibility checks, and if the element is intentionally covered or flaky add
the click option { force: true } only after investigating
hover/animation/visibility causes; update any related waits or assertions around
the configure-env locator to ensure the click reflects real user-visible
behavior.
- Around line 47-48: The test uses
newPage.locator('#configure-env').dispatchEvent('click') which bypasses normal
user interactions; replace this with a real user action such as awaiting
newPage.locator('#configure-env').click() (or await
newPage.click('#configure-env')) after the existing waitFor({ state: 'visible'
}) so the test exercises user-visible behaviour and events the same way a real
user would when invoking the Configure Env button.
In `@tests/environments/api-setEnvVar/api-setEnvVar-without-persist.spec.ts`:
- Around line 23-25: Replace synthetic dispatchEvent('click') calls on the
Playwright locator for '#configure-env' with locator.click() to use Playwright's
actionability checks; locate the usages of
page.locator('#configure-env').dispatchEvent('click') (there are two
occurrences, one near the initial open and another later) and change them to
await page.locator('#configure-env').click() so clicks are real user-like
interactions and tests become more stable.
In `@tests/import/insomnia/import-insomnia-v4-environments.spec.ts`:
- Line 83: Extract the repeated 15000 timeout into a named constant (e.g.,
ENV_FLATTEN_TIMEOUT_MS = 15000) at the top of the test file and replace the
three literal timeouts used in the locators/waits (the lines using
page.locator(...).waitFor({ state: 'visible', timeout: 15000 })) with timeout:
ENV_FLATTEN_TIMEOUT_MS so the tests reference the single constant for easier
tuning and maintenance.
In `@tests/import/insomnia/import-insomnia-v5-environments.spec.ts`:
- Line 80: Extract the repeated 15000 ms literal into a named constant (e.g.,
ENV_FLATTEN_TIMEOUT_MS = 15000) at the top of the test file and replace each
hard-coded timeout in the three waitFor calls (the one using
page.locator('input[value="config.debug"]').waitFor and the other two
occurrences referenced in the comment) with that constant; ensure any imports or
top-level test-level scope accommodate the new constant so all references
compile and maintain original behavior.
In `@tests/runner/collection-run-report/collection-run-report.spec.ts`:
- Around line 23-43: The test 'CLI: Run collection and generate JUnit report'
should be split into logical test.step blocks to improve report readability;
refactor the body of the test that currently uses createTmpDir, constructs
junitOutputPath, runs execSync(command), and asserts via normalizeJunitReport
into three await test.step calls (e.g., "Setup output directory", "Execute CLI
with JUnit reporter", "Verify report content") so each major action (creating
outputDir/junitOutputPath, running execSync, reading/normalizing and
snapshotting the report) is wrapped in its own test.step for clearer reporting.
🪄 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: d4528b38-5b32-413f-9ad0-fe78f1f8e421
📒 Files selected for processing (66)
.gitattributes.github/actions/common/setup-node-deps/action.yml.github/actions/ssl/linux/run-ssl-e2e-tests/action.yml.github/actions/ssl/macos/run-ssl-e2e-tests/action.yml.github/actions/ssl/windows/run-ssl-e2e-tests/action.yml.github/actions/tests/run-cli-tests/action.yml.github/actions/tests/run-e2e-tests/action.yml.github/actions/tests/run-unit-tests/action.yml.github/workflows/auth-tests.yml.github/workflows/ssl-tests.yml.github/workflows/tests-linux.yml.github/workflows/tests-macos.yml.github/workflows/tests-windows.ymlpackages/bruno-app/src/components/EnvironmentVariablesTable/index.jspackages/bruno-cli/package.jsonpackages/bruno-cli/src/commands/import.jspackages/bruno-converters/package.jsonpackages/bruno-electron/package.jsonpackages/bruno-electron/src/app/apiSpecsWatcher.jspackages/bruno-electron/src/app/collection-watcher.jspackages/bruno-electron/src/app/dotenv-watcher.jspackages/bruno-electron/src/app/workspace-watcher.jspackages/bruno-electron/src/index.jspackages/bruno-electron/src/store/shell-env-state.jspackages/bruno-js/package.jsonpackages/bruno-tests/collection/scripting/node-builtins/node-path.bruplaywright/index.tstests/codeeditor-state/fold-persistence.spec.tstests/collection/close-all-collections/close-all-collections.spec.tstests/cookies/cookie-persistence.spec.tstests/cookies/corrupted-passkey.spec.tstests/environments/api-setEnvVar/api-setEnvVar-with-persist.spec.tstests/environments/api-setEnvVar/api-setEnvVar-without-persist.spec.tstests/environments/api-setEnvVar/multiple-persist-vars.spec.tstests/environments/global-env-migration-from-file/global-env-migration-from-file.spec.tstests/environments/global-env-workspace-persistence/global-env-workspace-persistence.spec.tstests/environments/import-environment/collection-env-import.spec.tstests/environments/import-environment/global-env-import.spec.tstests/import/bulk-import/003-selection-list-viewport.spec.tstests/import/insomnia/import-insomnia-v4-environments.spec.tstests/import/insomnia/import-insomnia-v5-environments.spec.tstests/onboarding/sample-collection.spec.tstests/onboarding/welcome-modal.spec.tstests/preferences/default-collection-location/default-collection-location.spec.jstests/protobuf/manage-protofile.spec.tstests/proxy/pac/pac-proxy.spec.tstests/request/newlines/newlines-persistence.spec.tstests/request/response-pane-update-when-focused.spec.tstests/response/response-actions.spec.tstests/runner/collection-run-report/collection-run-report.spec.tstests/runner/collection-run-report/collection-run-report.spec.ts-snapshots/cli-junit-report-default-win32.xmltests/scratch-requests/scratch-requests.spec.tstests/shortcuts/bound-actions.spec.tstests/snapshots/basic.spec.tstests/snapshots/global-tabs.spec.tstests/snapshots/request-pane-interactivity.spec.tstests/snapshots/sidebar-state.spec.tstests/transient-requests/transient-requests.spec.tstests/utils/page/actions.tstests/workspace/close-tab-stays-in-workspace.spec.tstests/workspace/collection-reorder-persistence.spec.tstests/workspace/create-workspace/create-workspace.spec.tstests/workspace/default-workspace/default-workspace.spec.tstests/workspace/default-workspace/migration.spec.tstests/workspace/default-workspace/recovery-and-backup.spec.tstests/workspace/git-backed-collections/git-backed-collections.spec.ts
💤 Files with no reviewable changes (3)
- .github/workflows/auth-tests.yml
- .github/workflows/ssl-tests.yml
- packages/bruno-tests/collection/scripting/node-builtins/node-path.bru
Description
Updated branch from #7253
Contribution Checklist:
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
Release Notes
Bug Fixes
Tests