Test Observability on Cucumber JS
Quick start guide to integrate BrowserStack Test Observability with Cucumber JS
Prerequisites
- You have an account with BrowserStack (even a free trial works) and can get the Username and Access Key from your account profile.
- You have a Cucumber JS test suite (it is okay even if you do not run your tests on BrowserStack infrastructure).
- Node v12+ installed on your machine.
Integrate with Test Observability
BrowserStack Test Observability can be used regardless of where your tests run - whether on BrowserStack’s devices and browsers, locally on your laptop, CI machines, or using another cloud provider.
Not only that, Test Observability is agnostic to the type of testing and hence you could also integrate it with your unit or integration test suite written using CodeceptJS.
Please select your setup below to get started with an awesome debugging experience with Test Observability:
Install the latest version of the browserstack-node-sdk npm package
Install the BrowserStack SDK using npm
for your Cucumber JS based test suite for plug-and-play integration with BrowserStack.
The npx setup
command generates a browserstack.yml
file at the root location of your project with your access credentials already configured. It also adds new command(s) in your package.json
file to run tests on BrowserStack.
Please ensure that you have at least browserstack-node-sdk v1.34.8
before proceeding.
Make changes to the SDK config file
If you’ve installed the browserstack-node-sdk
for the first time, you’d have to create the browserstack.yml
file shown below. Else, just verify that your config file has all the required key-value pairs.
The projectName
and buildName
config must be static and not change across different runs of the same build. This is a deviation in approach as specified by BrowserStack Automate or App Automate as Test Observability will automatically identify different build runs.
Restrict the characters in your projectName
and buildName
to alphanumeric characters (A-Z, a-z, 0-9), underscores (_), colons (:), and hyphens (-). Any other character will be replaced with a space.
Create a browserstack.yml
file in the root folder of your test suite if it doesn’t exist.
BrowserStack SDK is a very powerful tool that you can use to set the different browser/device combinations and parallelization. For more details, check out the Automate integration guide.
Run your suite with BrowserStack Test Observability
Run your test script in the following format:
Post build run completion, you will see the build URL of Test Observability in your console. Alternatively, you can also navigate to your build run using Build Runs.
Install the latest version of the browserstack-node-sdk npm package
Install the BrowserStack SDK using npm
for your Cucumber JS based test suite for plug-and-play integration with BrowserStack.
The npx setup
command generates a browserstack.yml
file at the root location of your project with your access credentials already configured. It also adds new command(s) in your package.json
file to run tests on BrowserStack.
Please ensure that you have at least browserstack-node-sdk v1.34.8
before proceeding.
Make changes to the SDK config file
If you’ve installed the browserstack-node-sdk
for the first time, you’d have to create the browserstack.yml
file shown below. Else, just verify that your config file has all the required key-value pairs.
The projectName
and buildName
config must be static and not change across different runs of the same build. This is a deviation in approach as specified by BrowserStack Automate or App Automate as Test Observability will automatically identify different build runs.
Restrict the characters in your projectName
and buildName
to alphanumeric characters (A-Z, a-z, 0-9), underscores (_), colons (:), and hyphens (-). Any other character will be replaced with a space.
Create a browserstack.yml
file in the root folder of your test suite if it doesn’t exist.
BrowserStack SDK is a very powerful tool that you can use to set the different browser/device combinations and parallelization. For more details, check out the Automate integration guide.
Run your suite with BrowserStack Test Observability
Run your test script in the following format:
Post build run completion, you will see the build URL of Test Observability in your console. Alternatively, you can also navigate to your build run using Build Runs.
Install the latest version of the browserstack-node-sdk npm package
Install the BrowserStack SDK using npm
for your Cucumber JS based test suite for plug-and-play integration with BrowserStack.
The npx setup
command generates a browserstack.yml
file at the root location of your project with your access credentials already configured. It also adds new command(s) in your package.json
file to run tests on BrowserStack.
Please ensure that you have at least browserstack-node-sdk v1.34.8
before proceeding.
Create the browserstack.yml file
Run the following command to set your username and accesskey as environment variables:
Run your suite with BrowserStack Test Observability
Run your test script in the following format:
Post build run completion, you will see the build URL of Test Observability in your console. Alternatively, you can also navigate to your build run using Build Runs.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!