Skip to content

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

Merged
christian-bromann merged 171 commits intowebdriverio:v8from
rounak610:wdio_cli_v8_key_metrics
Sep 9, 2025
Merged

[v8] Implement BrowserStack CLI support in browserstack service#14617
christian-bromann merged 171 commits intowebdriverio:v8from
rounak610:wdio_cli_v8_key_metrics

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

@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!

@xxshubhamxx
Copy link
Contributor

Hi @christian-bromann
We have moved out the management of the proto files to an external npm module so that it doesn't affect the WebdriverIO project or complicates its build process.
Could you please review the PR?

.gitignore Outdated
Comment on lines +80 to +81
packages/wdio-browserstack-service/src/proto/*.ts

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
packages/wdio-browserstack-service/src/proto/*.ts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

"src/@types/**/*"
],
"exclude": [
"src/proto/**/*"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

* })
* ```
*/
commonCapabilities?: WebdriverIO.Capabilities
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should add an option for BS specific things

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@xxshubhamxx
Copy link
Contributor

Hi @christian-bromann,
I’ve implemented the changes from your review comments.
Could you please review again at the earliest convenience?

@xxshubhamxx
Copy link
Contributor

Hi @christian-bromann,
Gentle Reminder

@xxshubhamxx
Copy link
Contributor

Hi @christian-bromann,
Gentle Reminder

@xxshubhamxx
Copy link
Contributor

Hi @christian-bromann,
Gentle Reminder

@christian-bromann christian-bromann merged commit 232170e into webdriverio:v8 Sep 9, 2025
7 of 8 checks passed
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