Skip to content

Add support for BrowserStack Load Testing Service (LTS)#54

Merged
shubhamkd merged 1 commit into
nightwatchjs:mainfrom
MihirR-BS:LTS-tra-nightwatch-support
May 26, 2026
Merged

Add support for BrowserStack Load Testing Service (LTS)#54
shubhamkd merged 1 commit into
nightwatchjs:mainfrom
MihirR-BS:LTS-tra-nightwatch-support

Conversation

@MihirR-BS

Copy link
Copy Markdown
Contributor

Summary

Adds support for BrowserStack's Load Testing Service in @nightwatch/browserstack — an env-var-gated runtime mode that lets the plugin emit per-test rows correctly when the user's suite is running on BrowserStack's load-testing infrastructure (where the test runs against a local Selenium hub rather than the Automate hub).

What changes

Two files in src/:

File Change
utils/helper.js New isLoadTestingSession() / getLtsSessionId() helpers (env-driven via BROWSERSTACK_LTS_SESSION_ID); getCloudProvider() returns 'browserstack' under LTS so events flow through integrations.browserstack.*; getIntegrationsObject() session_id override + product='loadTesting' under LTS
testObservability.js getProductMapForBuildStartCall() sets automate=false + lts=true under LTS so build.source aligns with the LTS contract

Gating

All LTS code paths are gated on helper.isLoadTestingSession(). Returns true only when BROWSERSTACK_LTS_SESSION_ID is set in the environment (the LTS runtime exports it) or BROWSERSTACK_LTS=true/1 for local testing. Non-LTS Nightwatch runs see zero behavior change.

Type of change

Adds a new feature behind a runtime-only env-var gate. No public API or default-config changes.

Adds an env-var-gated mode that lets the plugin emit per-test rows
correctly when the user's suite is running on BrowserStack's load-
testing infrastructure (where the test runs against a local Selenium
hub rather than the Automate hub).

src/utils/helper.js
  - isLoadTestingSession() + getLtsSessionId() helpers, driven by the
    BROWSERSTACK_LTS_SESSION_ID env var (or BROWSERSTACK_LTS=true|1
    for local testing).
  - getCloudProvider() returns 'browserstack' under LTS so events
    flow through the integrations.browserstack.* path.
  - getIntegrationsObject() overrides session_id with the LTS env id
    and forces product='loadTesting' under LTS.

src/testObservability.js
  - getProductMapForBuildStartCall() sets automate=false + lts=true
    under LTS so build.source aligns with the LTS contract.

All LTS code paths are gated on helper.isLoadTestingSession().
Non-LTS Nightwatch runs see zero behavior change.
@shubhamkd shubhamkd merged commit 280ee88 into nightwatchjs:main May 26, 2026
6 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.

2 participants