Add support for BrowserStack Load Testing Service (LTS)#54
Merged
shubhamkd merged 1 commit intoMay 26, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/:utils/helper.jsisLoadTestingSession()/getLtsSessionId()helpers (env-driven viaBROWSERSTACK_LTS_SESSION_ID);getCloudProvider()returns'browserstack'under LTS so events flow throughintegrations.browserstack.*;getIntegrationsObject()session_id override +product='loadTesting'under LTStestObservability.jsgetProductMapForBuildStartCall()setsautomate=false+lts=trueunder LTS sobuild.sourcealigns with the LTS contractGating
All LTS code paths are gated on
helper.isLoadTestingSession(). Returnstrueonly whenBROWSERSTACK_LTS_SESSION_IDis set in the environment (the LTS runtime exports it) orBROWSERSTACK_LTS=true/1for 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.