Repository navigation
fix: allow users to clear the cache, adds environment tests and re-serialization addition - #8035
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR adds a "Clear caches on quit" option to ErrorBoundary that invokes an IPC to clear persisted snapshot state; the main process emits an internal reset event handled by snapshot IPC which calls SnapshotManager.resetSnapshot(); middleware tweaks preserve environment selections; Playwright tests validate persistence across restarts. ChangesCache-clear on force quit with environment persistence
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@packages/bruno-app/src/pages/ErrorBoundary/index.js`:
- Around line 83-89: The onClick handler currently returns immediately after
awaiting clearCache() when this.state.clearCaches is true, preventing
this.forceQuit() from running; change the control flow in the onClick handler
(the async arrow function attached to the button) so that after awaiting
this.clearCache() it still calls this.forceQuit() (e.g., await
this.clearCache(); this.forceQuit(); or call this.forceQuit() in a finally
block) ensuring both clearCache() and forceQuit() execute for the clear-caches
path.
- Around line 72-83: The new quit controls in ErrorBoundary (the checkbox bound
to this.state.clearCaches and the Force Quit anchor with the onClick handler)
lack stable selectors for Playwright; add data-testid attributes to both
elements (e.g., add data-testid="quit-clear-caches-checkbox" to the <input> tied
to this.setState({ clearCaches: ... }) and data-testid="force-quit-button" to
the <a> that triggers the Force Quit onClick) so tests can reliably target them
while leaving existing behavior and classNames untouched.
In `@packages/bruno-electron/src/services/snapshot/index.js`:
- Around line 190-200: resetSnapshot currently clears per-collection tabs but
leaves collection.activeTab intact and doesn't invalidate this._lookupCache,
which can cause stale or inconsistent reads; update resetSnapshot to also clear
any activeTab fields (e.g., set collection.activeTab = undefined or null
alongside tabs = []) for each collection and remove or reset this._lookupCache
(e.g., this._lookupCache = new Map() or delete/clear it) after updating store
entries so the in-memory lookup state is consistent with the cleared store.
🪄 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: f18f6711-69cd-49c4-a848-a8016f61a4ba
📒 Files selected for processing (4)
packages/bruno-app/src/pages/ErrorBoundary/index.jspackages/bruno-electron/src/index.jspackages/bruno-electron/src/ipc/snapshot.jspackages/bruno-electron/src/services/snapshot/index.js
There was a problem hiding this comment.
Pull request overview
Adds a “clear caches on quit” flow from the renderer error boundary into the Electron main process, delegating the actual persisted UI-state reset to the snapshot service so the app can restart with a cleaner slate after a forced quit.
Changes:
- Added
resetSnapshot()to clear parts of the persisted UI snapshot (workspace + tab state). - Added an internal IPC event to trigger snapshot reset, and a public
main:cache-clearhandler callable from the renderer. - Updated the ErrorBoundary UI to optionally clear caches before force-quitting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/bruno-electron/src/services/snapshot/index.js | Introduces resetSnapshot() to reset persisted snapshot state (workspaces/collections). |
| packages/bruno-electron/src/ipc/snapshot.js | Adds an internal IPC event to invoke snapshot reset from main process code. |
| packages/bruno-electron/src/index.js | Registers main:cache-clear IPC handler and delegates to internal snapshot reset event. |
| packages/bruno-app/src/pages/ErrorBoundary/index.js | Adds “Clear caches on quit” option and invokes main:cache-clear before force quit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
tests/snapshots/environment.spec.ts (2)
52-53: ⚡ Quick winReplace fixed sleeps with event-driven waits.
The
waitForTimeout(2000)calls make this suite slower and flaky; prefer waiting on a deterministic state change (UI or snapshot condition) instead.As per coding guidelines: "Replace magic timeouts with event-driven waits in E2E tests."
Also applies to: 147-155
🤖 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/snapshots/environment.spec.ts` around lines 52 - 53, Replace the fixed 2s sleep by waiting for a deterministic condition: replace the page.waitForTimeout(2000) calls with event-driven waits (e.g., page.waitForSelector(...) for a UI element that indicates the test snapshot is ready, page.waitForFunction(...) for a JS state flag, or page.waitForResponse(...) if waiting on network); only call closeElectronApp(app) after that condition resolves. Update every occurrence (including the other occurrences around the 147-155 block) to wait on a specific UI/state/response signal instead of using page.waitForTimeout, referencing the existing page.waitForTimeout and closeElectronApp(app) calls to locate and modify them.
46-49: ⚡ Quick winUse stable locators (and reuse locator variables) for environment assertions.
Using
.current-environmentties tests to CSS class structure; prefer role/label/test-id selectors and store the locator in a variable for reuse.As per coding guidelines: "Replace brittle text/index selectors with role, label, test id, or stable user-facing selectors."
Also applies to: 73-77, 113-120, 146-155
🤖 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/snapshots/environment.spec.ts` around lines 46 - 49, The assertions use a brittle CSS selector page.locator('.current-environment'); change them to a stable user-facing locator (e.g., use page.getByTestId or page.getByRole/getByLabel) and store that locator in a variable for reuse before the assertions (e.g., const env = page.getByTestId('current-environment') or similar), then replace the three occurrences (the ones around the openCollection calls and the other ranges noted) to use env and env.toContainText('local-a') / env.toContainText('local-b'); keep the existing openCollection(page, 'Collection B') calls untouched.
🤖 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.
Nitpick comments:
In `@tests/snapshots/environment.spec.ts`:
- Around line 52-53: Replace the fixed 2s sleep by waiting for a deterministic
condition: replace the page.waitForTimeout(2000) calls with event-driven waits
(e.g., page.waitForSelector(...) for a UI element that indicates the test
snapshot is ready, page.waitForFunction(...) for a JS state flag, or
page.waitForResponse(...) if waiting on network); only call
closeElectronApp(app) after that condition resolves. Update every occurrence
(including the other occurrences around the 147-155 block) to wait on a specific
UI/state/response signal instead of using page.waitForTimeout, referencing the
existing page.waitForTimeout and closeElectronApp(app) calls to locate and
modify them.
- Around line 46-49: The assertions use a brittle CSS selector
page.locator('.current-environment'); change them to a stable user-facing
locator (e.g., use page.getByTestId or page.getByRole/getByLabel) and store that
locator in a variable for reuse before the assertions (e.g., const env =
page.getByTestId('current-environment') or similar), then replace the three
occurrences (the ones around the openCollection calls and the other ranges
noted) to use env and env.toContainText('local-a') /
env.toContainText('local-b'); keep the existing openCollection(page, 'Collection
B') calls untouched.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 240105b2-55fe-4046-8bf8-6056e5837e0a
📒 Files selected for processing (4)
packages/bruno-app/src/pages/ErrorBoundary/index.jspackages/bruno-app/src/providers/ReduxStore/middlewares/snapshot/middleware.jspackages/bruno-electron/src/services/snapshot/index.jstests/snapshots/environment.spec.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
tests/snapshots/environment/environment.spec.ts (3)
47-47: ⚡ Quick winReplace fixed 2s sleeps with event-driven waits.
These waits are brittle and slow; prefer waiting on observable outcomes (UI state or snapshot persistence) instead of time-based delays.
As per coding guidelines, "Replace magic timeouts with event-driven waits in E2E tests."Suggested direction
- await page.waitForTimeout(2000); + await expect.poll(() => { + const snapshot = readSnapshot(userDataPath); + return Array.isArray(snapshot?.collections) ? snapshot.collections.length : 0; + }).toBeGreaterThan(0);Also applies to: 100-100, 195-195, 199-199, 203-203
🤖 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/snapshots/environment/environment.spec.ts` at line 47, The fixed 2s sleeps (calls to page.waitForTimeout) are brittle; replace each occurrence (e.g., the call at tests/snapshots/environment/environment.spec.ts and the other occurrences around lines referenced) with event-driven waits such as page.waitForSelector, page.waitForResponse, or page.waitForFunction that assert the observable outcome you care about (UI element visible/hidden, network response for snapshot save, or a DOM state change) so tests wait for the specific condition (snapshot persistence or UI update) instead of a magic timeout; locate and update each page.waitForTimeout usage in this spec to wait for the relevant selector/response/function that indicates the operation completed.
43-43: ⚡ Quick winUse stable locators (prefer
data-testid) instead of raw class selectors.
.current-environmentis fragile for UI refactors; use a stable test id/role and a locator variable reused across assertions.As per coding guidelines, "Replace brittle text/index selectors with role, label, test id, or stable user-facing selectors" and "Add
data-testidto testable elements for Playwright in React components".Also applies to: 94-94, 96-96, 161-161, 164-164, 167-167, 194-194, 198-198, 202-202
🤖 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/snapshots/environment/environment.spec.ts` at line 43, Replace fragile class-based selectors like page.locator('.current-environment') with stable test ids and reuse a locator variable: update the React components to add data-testid attributes (e.g., data-testid="current-environment") and then in the test file replace direct calls to page.locator('.current-environment') with a single const currentEnv = page.getByTestId('current-environment') (or page.locator('[data-testid="current-environment"]')) and use that variable for all assertions (including the other occurrences mentioned) to make locators stable and DRY.
35-68: ⚡ Quick winGuarantee Electron app cleanup with
try/finallyin each test.If an assertion fails before the close step, app processes can leak and hurt parallel safety.
As per coding guidelines, "E2E tests must be parallel-safe" and "Every E2E test should follow the Arrange-Act-Assert-Cleanup shape".
Also applies to: 77-128, 139-219
🤖 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/snapshots/environment/environment.spec.ts` around lines 35 - 68, Wrap the test body that calls launchElectronApp(...) and uses waitForReadyPage(...) in a try/finally so closeElectronApp(app) is always called (and page cleanup if needed) — move the assertions and interactions (openCollection, expects, snapshot reads) into the try block and call closeElectronApp(app) in finally, guarding against undefined app; apply the same try/finally pattern to the other tests noted (the blocks covering lines 77-128 and 139-219) to guarantee Electron process cleanup and parallel-safe E2E tests.
🤖 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 `@tests/snapshots/environment/environment.spec.ts`:
- Line 32: The test entry uses test.only which will cause the rest of the suite
to be skipped; change the invocation in the "migrates legacy snapshot format and
preserves selected collection environment" test from test.only to test (i.e.,
remove .only) so the full test suite runs, then run the test suite locally to
confirm no accidental focused tests remain; look for the test declaration string
to locate the correct spot.
---
Nitpick comments:
In `@tests/snapshots/environment/environment.spec.ts`:
- Line 47: The fixed 2s sleeps (calls to page.waitForTimeout) are brittle;
replace each occurrence (e.g., the call at
tests/snapshots/environment/environment.spec.ts and the other occurrences around
lines referenced) with event-driven waits such as page.waitForSelector,
page.waitForResponse, or page.waitForFunction that assert the observable outcome
you care about (UI element visible/hidden, network response for snapshot save,
or a DOM state change) so tests wait for the specific condition (snapshot
persistence or UI update) instead of a magic timeout; locate and update each
page.waitForTimeout usage in this spec to wait for the relevant
selector/response/function that indicates the operation completed.
- Line 43: Replace fragile class-based selectors like
page.locator('.current-environment') with stable test ids and reuse a locator
variable: update the React components to add data-testid attributes (e.g.,
data-testid="current-environment") and then in the test file replace direct
calls to page.locator('.current-environment') with a single const currentEnv =
page.getByTestId('current-environment') (or
page.locator('[data-testid="current-environment"]')) and use that variable for
all assertions (including the other occurrences mentioned) to make locators
stable and DRY.
- Around line 35-68: Wrap the test body that calls launchElectronApp(...) and
uses waitForReadyPage(...) in a try/finally so closeElectronApp(app) is always
called (and page cleanup if needed) — move the assertions and interactions
(openCollection, expects, snapshot reads) into the try block and call
closeElectronApp(app) in finally, guarding against undefined app; apply the same
try/finally pattern to the other tests noted (the blocks covering lines 77-128
and 139-219) to guarantee Electron process cleanup and parallel-safe E2E tests.
🪄 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: 237cb745-4303-4db4-9ffa-67c6c8692068
📒 Files selected for processing (7)
packages/bruno-electron/src/ipc/snapshot.jstests/snapshots/environment/environment.spec.tstests/snapshots/environment/fixtures/collection/bruno.jsontests/snapshots/environment/fixtures/collection/environments/local.brutests/snapshots/environment/fixtures/collection/request.brutests/snapshots/environment/init-user-data/preferences.jsontests/snapshots/environment/init-user-data/ui-state-snapshot.json
✅ Files skipped from review due to trivial changes (4)
- tests/snapshots/environment/init-user-data/ui-state-snapshot.json
- tests/snapshots/environment/init-user-data/preferences.json
- tests/snapshots/environment/fixtures/collection/environments/local.bru
- tests/snapshots/environment/fixtures/collection/request.bru
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/bruno-electron/src/ipc/snapshot.js
…no#7660) * feat: add new status assertions and negated variants for response checks - Introduced new status assertions: `pm.response.to.be.info`, `pm.response.to.be.accepted`, `pm.response.to.be.badRequest`, `pm.response.to.be.unauthorized`, `pm.response.to.be.forbidden`, `pm.response.to.be.notFound`, `pm.response.to.be.rateLimited`, and `pm.response.to.be.withoutBody`. - Implemented negated variants for existing assertions, allowing checks like `pm.response.to.not.be.ok` and `pm.response.to.not.be.success`. - Enhanced test coverage to validate the translation of these new assertions and their negated forms in the Postman to Bruno conversion process. * refactor: update response translation for body assertions - Changed the translation logic for `pm.response.to.be.withoutBody` to `pm.response.to.be.withBody`, reflecting the actual body content checks. - Updated corresponding test cases to validate the new assertions and ensure correct translation behavior for body presence checks. - Enhanced negated variants for body assertions to align with the updated logic. * feat: add header transformation methods for Postman to Bruno conversion - Introduced new transformations for `pm.request.headers.prepend`, `pm.request.headers.insert`, and `pm.request.headers.insertAfter` to map to `req.headerList.add`, enhancing header management during the conversion process. - Updated the transformation logic to ensure only the first argument is retained for these methods, aligning with the intended behavior of the header list operations. * refactor: update header transformation logic for Postman to Bruno conversion - Simplified the transformation for `pm.response.to.have.header` and `pm.response.to.not.have.header` to use `res.getHeader` instead of `res.getHeaders`, improving clarity and consistency in the assertions. - Adjusted related test cases to validate the new transformation logic, ensuring accurate translation of header checks in the conversion process. * refactor: update header transformation logic for Postman to Bruno conversion - Enhanced the transformation for `pm.response.to.have.header` and `pm.response.to.not.have.header` to utilize `res.getHeaders()` with lowercased header names, improving consistency and accuracy in header assertions. - Updated related test cases to reflect the new transformation logic, ensuring correct translation of header checks in the conversion process. * feat: add data-driven status assertions for response checks - Introduced a new utility to generate data-driven status assertion entries for `pm.response.to.be.*` checks, including positive and negated variants. - Integrated the new status assertions into the Postman to Bruno translation logic, enhancing the capability to handle various response status checks. - Updated tests to validate the translation of new assertions, ensuring accurate conversion of status checks in the response handling process. * feat: enhance response assertion translations for negated variants - Updated the transformation logic for `pm.response.to.have.*` assertions to include negated variants, allowing for patterns like `pm.response.to.have.not.status`, `pm.response.to.have.not.header`, and `pm.response.to.have.not.body`. - Adjusted related test cases to validate the new translations, ensuring accurate conversion of negated assertions in the response handling process. * refactor: convert status assertion utility to ES module syntax - Changed the export of `buildStatusAssertionEntries` to ES module syntax for better compatibility with modern JavaScript practices. - Updated the import statement in the Postman to Bruno translator to reflect the new export format, ensuring seamless integration of the status assertion utility. * feat: update response body assertion translations to use undefined checks - Modified the transformation logic for `pm.response.to.be.withBody`, `pm.response.to.not.be.withBody`, and `pm.response.to.be.not.withBody` to use an undefined check instead of truthiness, allowing for accurate handling of falsy body values. - Updated related test cases to reflect these changes, ensuring correct translation of body presence assertions in the response handling process.
…sebruno#8038) - Updated the Postman collection importer to handle collections wrapped in a { collection: { ... } } format. - Enhanced the parsing logic to extract collection info correctly from both legacy and newer formats. - Added a new test case for importing a Postman v2.1 collection with the wrapped format to ensure compatibility.
…rialization addition (usebruno#8035) * internal emit chain for clearance * fix: crash ui * fix(ErrorBoundary): ensure cache clearing is awaited before force quitting * test(e2e): environment persistence across collections * test: migration test * Update environment.spec.ts * feat: add missing status assertions and .not negation support (usebruno#7660) * feat: add new status assertions and negated variants for response checks - Introduced new status assertions: `pm.response.to.be.info`, `pm.response.to.be.accepted`, `pm.response.to.be.badRequest`, `pm.response.to.be.unauthorized`, `pm.response.to.be.forbidden`, `pm.response.to.be.notFound`, `pm.response.to.be.rateLimited`, and `pm.response.to.be.withoutBody`. - Implemented negated variants for existing assertions, allowing checks like `pm.response.to.not.be.ok` and `pm.response.to.not.be.success`. - Enhanced test coverage to validate the translation of these new assertions and their negated forms in the Postman to Bruno conversion process. * refactor: update response translation for body assertions - Changed the translation logic for `pm.response.to.be.withoutBody` to `pm.response.to.be.withBody`, reflecting the actual body content checks. - Updated corresponding test cases to validate the new assertions and ensure correct translation behavior for body presence checks. - Enhanced negated variants for body assertions to align with the updated logic. * feat: add header transformation methods for Postman to Bruno conversion - Introduced new transformations for `pm.request.headers.prepend`, `pm.request.headers.insert`, and `pm.request.headers.insertAfter` to map to `req.headerList.add`, enhancing header management during the conversion process. - Updated the transformation logic to ensure only the first argument is retained for these methods, aligning with the intended behavior of the header list operations. * refactor: update header transformation logic for Postman to Bruno conversion - Simplified the transformation for `pm.response.to.have.header` and `pm.response.to.not.have.header` to use `res.getHeader` instead of `res.getHeaders`, improving clarity and consistency in the assertions. - Adjusted related test cases to validate the new transformation logic, ensuring accurate translation of header checks in the conversion process. * refactor: update header transformation logic for Postman to Bruno conversion - Enhanced the transformation for `pm.response.to.have.header` and `pm.response.to.not.have.header` to utilize `res.getHeaders()` with lowercased header names, improving consistency and accuracy in header assertions. - Updated related test cases to reflect the new transformation logic, ensuring correct translation of header checks in the conversion process. * feat: add data-driven status assertions for response checks - Introduced a new utility to generate data-driven status assertion entries for `pm.response.to.be.*` checks, including positive and negated variants. - Integrated the new status assertions into the Postman to Bruno translation logic, enhancing the capability to handle various response status checks. - Updated tests to validate the translation of new assertions, ensuring accurate conversion of status checks in the response handling process. * feat: enhance response assertion translations for negated variants - Updated the transformation logic for `pm.response.to.have.*` assertions to include negated variants, allowing for patterns like `pm.response.to.have.not.status`, `pm.response.to.have.not.header`, and `pm.response.to.have.not.body`. - Adjusted related test cases to validate the new translations, ensuring accurate conversion of negated assertions in the response handling process. * refactor: convert status assertion utility to ES module syntax - Changed the export of `buildStatusAssertionEntries` to ES module syntax for better compatibility with modern JavaScript practices. - Updated the import statement in the Postman to Bruno translator to reflect the new export format, ensuring seamless integration of the status assertion utility. * feat: update response body assertion translations to use undefined checks - Modified the transformation logic for `pm.response.to.be.withBody`, `pm.response.to.not.be.withBody`, and `pm.response.to.be.not.withBody` to use an undefined check instead of truthiness, allowing for accurate handling of falsy body values. - Updated related test cases to reflect these changes, ensuring correct translation of body presence assertions in the response handling process. * feat: support newer Postman export format with collection envelope (usebruno#8038) - Updated the Postman collection importer to handle collections wrapped in a { collection: { ... } } format. - Enhanced the parsing logic to extract collection info correctly from both legacy and newer formats. - Added a new test case for importing a Postman v2.1 collection with the wrapped format to ensure compatibility. * fix: reduce padding for dark mode app errors --------- Co-authored-by: sanish chirayath <[email protected]>
…rialization addition (usebruno#8035) * internal emit chain for clearance * fix: crash ui * fix(ErrorBoundary): ensure cache clearing is awaited before force quitting * test(e2e): environment persistence across collections * test: migration test * Update environment.spec.ts * feat: add missing status assertions and .not negation support (usebruno#7660) * feat: add new status assertions and negated variants for response checks - Introduced new status assertions: `pm.response.to.be.info`, `pm.response.to.be.accepted`, `pm.response.to.be.badRequest`, `pm.response.to.be.unauthorized`, `pm.response.to.be.forbidden`, `pm.response.to.be.notFound`, `pm.response.to.be.rateLimited`, and `pm.response.to.be.withoutBody`. - Implemented negated variants for existing assertions, allowing checks like `pm.response.to.not.be.ok` and `pm.response.to.not.be.success`. - Enhanced test coverage to validate the translation of these new assertions and their negated forms in the Postman to Bruno conversion process. * refactor: update response translation for body assertions - Changed the translation logic for `pm.response.to.be.withoutBody` to `pm.response.to.be.withBody`, reflecting the actual body content checks. - Updated corresponding test cases to validate the new assertions and ensure correct translation behavior for body presence checks. - Enhanced negated variants for body assertions to align with the updated logic. * feat: add header transformation methods for Postman to Bruno conversion - Introduced new transformations for `pm.request.headers.prepend`, `pm.request.headers.insert`, and `pm.request.headers.insertAfter` to map to `req.headerList.add`, enhancing header management during the conversion process. - Updated the transformation logic to ensure only the first argument is retained for these methods, aligning with the intended behavior of the header list operations. * refactor: update header transformation logic for Postman to Bruno conversion - Simplified the transformation for `pm.response.to.have.header` and `pm.response.to.not.have.header` to use `res.getHeader` instead of `res.getHeaders`, improving clarity and consistency in the assertions. - Adjusted related test cases to validate the new transformation logic, ensuring accurate translation of header checks in the conversion process. * refactor: update header transformation logic for Postman to Bruno conversion - Enhanced the transformation for `pm.response.to.have.header` and `pm.response.to.not.have.header` to utilize `res.getHeaders()` with lowercased header names, improving consistency and accuracy in header assertions. - Updated related test cases to reflect the new transformation logic, ensuring correct translation of header checks in the conversion process. * feat: add data-driven status assertions for response checks - Introduced a new utility to generate data-driven status assertion entries for `pm.response.to.be.*` checks, including positive and negated variants. - Integrated the new status assertions into the Postman to Bruno translation logic, enhancing the capability to handle various response status checks. - Updated tests to validate the translation of new assertions, ensuring accurate conversion of status checks in the response handling process. * feat: enhance response assertion translations for negated variants - Updated the transformation logic for `pm.response.to.have.*` assertions to include negated variants, allowing for patterns like `pm.response.to.have.not.status`, `pm.response.to.have.not.header`, and `pm.response.to.have.not.body`. - Adjusted related test cases to validate the new translations, ensuring accurate conversion of negated assertions in the response handling process. * refactor: convert status assertion utility to ES module syntax - Changed the export of `buildStatusAssertionEntries` to ES module syntax for better compatibility with modern JavaScript practices. - Updated the import statement in the Postman to Bruno translator to reflect the new export format, ensuring seamless integration of the status assertion utility. * feat: update response body assertion translations to use undefined checks - Modified the transformation logic for `pm.response.to.be.withBody`, `pm.response.to.not.be.withBody`, and `pm.response.to.be.not.withBody` to use an undefined check instead of truthiness, allowing for accurate handling of falsy body values. - Updated related test cases to reflect these changes, ensuring correct translation of body presence assertions in the response handling process. * feat: support newer Postman export format with collection envelope (usebruno#8038) - Updated the Postman collection importer to handle collections wrapped in a { collection: { ... } } format. - Enhanced the parsing logic to extract collection info correctly from both legacy and newer formats. - Added a new test case for importing a Postman v2.1 collection with the wrapped format to ensure compatibility. * fix: reduce padding for dark mode app errors --------- Co-authored-by: sanish chirayath <[email protected]>
Description
JIRA
JIRA 2
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
New Features
Bug Fixes
Tests