Skip to content

refactor: update runner tests to use new filter implementation and reusable helpers#6085

Merged
sid-bruno merged 14 commits intousebruno:feature/collection-test-results-and-filtering-internalfrom
chirag-bruno:feature/collection-test-results-and-filtering
Nov 13, 2025
Merged

refactor: update runner tests to use new filter implementation and reusable helpers#6085
sid-bruno merged 14 commits intousebruno:feature/collection-test-results-and-filtering-internalfrom
chirag-bruno:feature/collection-test-results-and-filtering

Conversation

@chirag-bruno
Copy link
Collaborator

Description

  • Update tests to read test result counts from filter buttons instead of deprecated 'Total Requests' text

  • Create reusable helper functions in tests/utils/page/runner.ts:
    * getRunnerResultCounts() - reads counts from filter button badges
    * runCollection() - handles collection running with reset logic
    * setSandboxMode() - sets up developer/safe mode with badge handling
    * validateRunnerResults() - validates test results against expected counts

  • Refactor 9 test files to use helper functions:

    • tests/runner/collection-run.ts
    • tests/scripting/inbuilt-libraries/jsonwebtoken/jsonwebtoken.spec.ts
    • All 7 SSL test files (basic-ssl and custom-ca-certs)
    • Reduce code duplication: ~50 lines per test → ~10 lines per test
    • Improve maintainability: centralized logic for common test operations
    • Fix test execution: changed serial tests to parallel where appropriate to prevent skipped tests
    • Handle security settings tab opening: click badge to open tab when mode already selected

    This refactoring accommodates the new filter implementation in the runner results UI
    and significantly improves test code maintainability.

Contribution Checklist:

  • 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.

morgan-se and others added 14 commits January 16, 2025 11:31
Added breakdown of test results within collection.
Added filtering based on passing/failing requests and tests by click on results text.
- Add unified filter bar (All/Passed/Failed/Skipped) with counts and active indicator
- Implement filtering that filters both requests and tests within requests
- Move action buttons to top bar, prevent filter wrapping
- Add close button and placeholder to response view
- Update styling for light/dark modes with proper colors and typography
…ring logic

- Restore original function formatting with return statements and braces
- Restore removed input attributes (autoCorrect, autoCapitalize, spellCheck)
- Revert ternary operator changes to match original code style
- Restore original variable names (savedConfiguration) and comments
- Restore original test results rendering structure
- Preserve new filter bar UI, filtering logic, and response view improvements
- Only auto-scroll when user is near the bottom (within 100px)
- Preserve user's scroll position if they've scrolled up to view content
- Move ref to actual scrollable container for proper scroll detection
…b.com:chirag-bruno/bruno into feature/collection-test-results-and-filtering
… into feature/collection-test-results-and-filtering
…usable helpers

- Update tests to read test result counts from filter buttons instead of deprecated 'Total Requests' text
- Create reusable helper functions in tests/utils/page/runner.ts:
  * getRunnerResultCounts() - reads counts from filter button badges
  * runCollection() - handles collection running with reset logic
  * setSandboxMode() - sets up developer/safe mode with badge handling
  * validateRunnerResults() - validates test results against expected counts
- Refactor 9 test files to use helper functions:
  * tests/runner/collection-run.ts
  * tests/scripting/inbuilt-libraries/jsonwebtoken/jsonwebtoken.spec.ts
  * All 7 SSL test files (basic-ssl and custom-ca-certs)
- Reduce code duplication: ~50 lines per test → ~10 lines per test
- Improve maintainability: centralized logic for common test operations
- Fix test execution: changed serial tests to parallel where appropriate to prevent skipped tests
- Handle security settings tab opening: click badge to open tab when mode already selected

This refactoring accommodates the new filter implementation in the runner results UI
and significantly improves test code maintainability.
@sid-bruno sid-bruno closed this Nov 13, 2025
@sid-bruno sid-bruno reopened this Nov 13, 2025
@sid-bruno sid-bruno changed the base branch from feature/collection-test-results-and-filtering-internal to main November 13, 2025 10:02
@sid-bruno sid-bruno changed the base branch from main to feature/collection-test-results-and-filtering-internal November 13, 2025 10:02
@sid-bruno
Copy link
Collaborator

Switching base to main to make sure tests run

@sid-bruno sid-bruno changed the base branch from feature/collection-test-results-and-filtering-internal to main November 13, 2025 10:03
@sid-bruno sid-bruno closed this Nov 13, 2025
@sid-bruno sid-bruno reopened this Nov 13, 2025
@sid-bruno sid-bruno changed the base branch from main to feature/collection-test-results-and-filtering-internal November 13, 2025 10:25
@sid-bruno sid-bruno merged commit 6049530 into usebruno:feature/collection-test-results-and-filtering-internal Nov 13, 2025
6 of 7 checks passed
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.

3 participants