Skip to content

test: Adds missing methods to BrowserStackAPI, deprecate credentials#26230

Merged
christopherferreira9 merged 13 commits into
mainfrom
MMQA-1457-migrate-the-browser-stack-client
Feb 20, 2026
Merged

test: Adds missing methods to BrowserStackAPI, deprecate credentials#26230
christopherferreira9 merged 13 commits into
mainfrom
MMQA-1457-migrate-the-browser-stack-client

Conversation

@christopherferreira9

@christopherferreira9 christopherferreira9 commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Description

  • Consolidated all BrowserStack API interactions into the existing BrowserStackAPI.ts class, eliminating the redundant BrowserStackCredentials.js utility
  • Made BrowserStackAPI constructor resilient — no longer throws when credentials are missing; API methods return null gracefully instead
  • Added getAppProfilingData() and getNetworkLogs() endpoints to BrowserStackAPI.ts
  • Updated AppProfilingDataHandler.js, PerformanceTracker.js, and custom-reporter.js to use BrowserStackAPI instead of BrowserStackCredentials + raw axios/fetch calls
  • Removed manual credential checks in custom-reporter.js — the API handles missing credentials internally
  • Deleted BrowserStackCredentials.js and cleaned up all references

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMQA-1457

Manual testing steps

N/A

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Touches CI/test reporting flows and changes error/credential behavior (now returning null instead of throwing), which could alter how BrowserStack artifacts are fetched and retried; impact is limited to test infrastructure, not production code.

Overview
Centralizes BrowserStack interactions into BrowserStackAPI.ts: the client no longer throws on missing env credentials, API methods return null with warnings, requests use a shared 8s timeout, and failures now throw a BrowserStackAPIError that preserves HTTP status and response body.

Adds new API methods for app profiling (/appprofiling/v2) and session network logs (/networklogs), exports the new error type, and updates performance reporters (AppProfilingDataHandler, PerformanceTracker, custom-reporter) to stop using axios/manual auth checks, fetch buildId explicitly for network logs, and skip/fallback cleanly when buildId or credentials are unavailable. Removes the redundant BrowserStackCredentials.js helper and associated README mention.

Written by Cursor Bugbot for commit cd2dfeb. This will update automatically on new commits. Configure here.

@christopherferreira9 christopherferreira9 requested a review from a team as a code owner February 18, 2026 16:31
@christopherferreira9 christopherferreira9 added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Feb 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-qa QA team label Feb 18, 2026
Comment thread tests/reporters/PerformanceTracker.js
Comment thread tests/framework/services/providers/browserstack/BrowserStackAPI.ts
Comment thread tests/reporters/custom-reporter.js
Comment thread tests/reporters/PerformanceTracker.js Outdated
Comment thread tests/framework/services/providers/browserstack/BrowserStackAPI.ts
Comment thread tests/reporters/custom-reporter.js Outdated
@christopherferreira9 christopherferreira9 added the skip-e2e skip E2E test jobs label Feb 18, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread tests/framework/services/providers/browserstack/BrowserStackAPI.ts
Base automatically changed from MMQA-1468-migrate-timers-to-the-new-framework to main February 19, 2026 10:32
@christopherferreira9 christopherferreira9 requested a review from a team as a code owner February 19, 2026 10:32
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: @PerformanceOnboarding, @PerformanceLogin, @PerformancePreps, @PerformancePredict
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR contains only test infrastructure changes related to BrowserStack API integration for test reporting. The changes include:

  1. Refactoring BrowserStackAPI.ts to add new methods (getAppProfilingData, getNetworkLogs) and better error handling
  2. Deleting BrowserStackCredentials.js utility class (functionality consolidated into BrowserStackAPI)
  3. Updating AppProfilingDataHandler.js and PerformanceTracker.js to use the refactored BrowserStackAPI
  4. Updating custom-reporter.js to handle the new API signatures
  5. Documentation update in README.md

These changes do NOT affect:

  • Any application code (app/ directory)
  • Any E2E test logic or test specs
  • Any page objects or test fixtures that execute tests
  • Any user-facing functionality

The changes are purely internal refactoring of how test reporters communicate with BrowserStack's API for collecting test results, video URLs, profiling data, and network logs. Since no application code or test execution logic is modified, no E2E tests are needed to validate these changes.

Performance Test Selection:
The changes directly affect the performance test infrastructure - specifically PerformanceTracker.js and AppProfilingDataHandler.js which are core components used by all performance tests. The PerformanceTracker is used as a fixture in performance tests to collect timing metrics and attach them to test results. The AppProfilingDataHandler fetches profiling data from BrowserStack. Running performance tests will validate that the refactored BrowserStack API integration works correctly for collecting performance metrics. Selected tags cover the main performance test categories that use these components: onboarding flows, login flows, perps add funds, and predict balance tests.

View GitHub Actions results

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.17%. Comparing base (5a30a48) to head (cd2dfeb).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26230      +/-   ##
==========================================
- Coverage   81.18%   81.17%   -0.01%     
==========================================
  Files        4429     4429              
  Lines      115640   115653      +13     
  Branches    24926    24933       +7     
==========================================
+ Hits        93882    93885       +3     
- Misses      15226    15232       +6     
- Partials     6532     6536       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@christopherferreira9 christopherferreira9 added this pull request to the merge queue Feb 20, 2026
Merged via the queue into main with commit e5be198 Feb 20, 2026
76 of 84 checks passed
@christopherferreira9 christopherferreira9 deleted the MMQA-1457-migrate-the-browser-stack-client branch February 20, 2026 10:47
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 20, 2026
@metamaskbot metamaskbot added the release-7.68.0 Issue or pull request that will be included in release 7.68.0 label Feb 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.68.0 Issue or pull request that will be included in release 7.68.0 size-M skip-e2e skip E2E test jobs team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants