Skip to content

[v8] Implement BrowserStack CLI support in browserstack service #14617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 148 commits into
base: v8
Choose a base branch
from

Conversation

AdityaHirapara
Copy link
Contributor

Proposed changes

This implements changes in the BrowserStack service to enable BrowserStack products via BrowserStack CLI in the background.
As per the discussion here, this is to work in the direction of moving BrowserStack product-related logic out of webdriverio.

To summarise changes, this implementation consists of

  • Implementation of CLI binary download, start, connect, and stop workflows.
  • Framework instance to share context of ongoing test, and track test events to perform browserstack logic inside test lifecycle
  • Automation instance (similar to test instance) to share context of the browser(driver) running test, and track driver events lifecycle.
  • Product modules which register events on test and driver lifecycle, to perform product logic.
  • grpc utils and protobuffer files to implement communication between CLI binary and WDIO service.
  • Additionally, for now, we will need to keep old modules for fallback, in case the CLI flow fails. We can remove old code, once we verify the stability of the CLI flow.

Types of changes

  • Polish (an improvement for an existing feature)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Backport Request

//: # (The current main branch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against the v8 branch.)

  • This change is solely for v9 and doesn't need to be back-ported
  • Back-ported PR at #XXXXX

Further comments

Reviewers: @webdriverio/project-committers

Copy link

linux-foundation-easycla bot commented Jul 7, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@xxshubhamxx
Copy link
Contributor

/easycla

1 similar comment
@AdityaHirapara
Copy link
Contributor Author

/easycla

@rounak610
Copy link
Contributor

@christian-bromann Could you please review this PR.

@AdityaHirapara
Copy link
Contributor Author

@christian-bromann This is complete v8 implementation of discussion in #14456. As mentioned in our last conversation, we had decided to implement support on v8 first, based on users' asks.

@AdityaHirapara
Copy link
Contributor Author

Hi @christian-bromann,
As per your suggestions on the linked PR — we discussed this internally and agree with the direction of moving the GRPC-related modules out of the WDIO service and into a separate npm package to streamline the build process.
That said, due to current priorities, we won't be able to take this up immediately. We're planning to allocate time in the next 2 quarters to begin this migration effort.
In the meantime, would it be okay to release these GRPC-related changes as part of the browserstack-service, so we can unblock dependent workstreams? We'll ensure the eventual migration is handled cleanly when we revisit it in the coming quarter.

@christian-bromann
Copy link
Member

I don't think it is a good idea to introduce tech debt to the WebdriverIO project that complicates the build process. Moving it into a separate NPM package doesn't sound much time consuming either.

@AdityaHirapara
Copy link
Contributor Author

@christian-bromann, as you suggested, we will move proto files to a separate npm package, and publish compiled js files to import in browserstack service. This includes all .proto files at packages/wdio-browserstack-service/src/proto/browserstack/sdk/v1/.
Post that, can we consider this PR good for review and merge?

@christian-bromann
Copy link
Member

Post that, can we consider this PR good for review and merge?

Sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants