refactor(provider-webdriver): share hub upload helpers and bound session-details lookups

Closed
AM
2mo ago
+597-172

Summary

First core piece split out of #3118. It contains no TestMu code.

  • Moves BrowserStack's upload, install, app-reference and URL-artifact code into shared helpers in webdriver-utils.ts and artifact-results.ts. This is groundwork for the WebDriver host port named as the next prerequisite in the #3118 review.
  • Connection verification goes through one fetchProviderVerificationJson. sameOsVersion and the orientation check move next to the other shared helpers.
  • Session-details lookups go through fetchProviderSessionDetails, which sets a 15 s deadline. Every failure, including a timeout or a body that is not JSON, becomes a typed COMMAND_FAILED. A JSON array is no longer read as session details.
  • Small BrowserStack behaviour changes:
    • An upload reply that is not JSON is now COMMAND_FAILED and carries the HTTP status.
    • An http(s) --provider-app URL now matches its scheme case-insensitively.

Validation

  • pnpm check:affected --base main --run passes.
  • eager-closure-budgets passes: provider-webdriver still evaluates 49 modules on import.
  • Removing the deadline makes the new test fail.
  • Not run live against BrowserStack.

🤖 Generated with Claude Code