Skip to main content
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Test Reporting & Analytics on Cucumber JS

Quick start guide to integrate BrowserStack Test Reporting & Analytics 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 Reporting & Analytics

BrowserStack Test Reporting & Analytics 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 Reporting & Analytics 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 Reporting & Analytics:

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.

Terminal
Copy icon Copy

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 Reporting & Analytics 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 (:), square brackets ([, ]), and hyphens (-). Any other character will be replaced with an underscore (_).

Create a browserstack.yml file in the root folder of your test suite if it doesn’t exist.

browserstack.yml
Copy icon Copy

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 Reporting & Analytics

Run your test script in the following format:

Terminal
Copy icon Copy

Post build run completion, you will see the build URL of Test Reporting & Analytics in your console. Alternatively, you can also navigate to your build run using Build Runs.

Visit Test Reporting & Analytics

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.

Terminal
Copy icon Copy

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 Reporting & Analytics 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 (:), square brackets ([, ]), and hyphens (-). Any other character will be replaced with an underscore (_).

Create a browserstack.yml file in the root folder of your test suite if it doesn’t exist.

browserstack.yml
Copy icon Copy

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 Reporting & Analytics

Run your test script in the following format:

Terminal
Copy icon Copy

Post build run completion, you will see the build URL of Test Reporting & Analytics in your console. Alternatively, you can also navigate to your build run using Build Runs.

Visit Test Reporting & Analytics

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.

Terminal
Copy icon Copy

Create the browserstack.yml file

Run the following command to set your username and accesskey as environment variables:

Terminal
Copy icon Copy

Run your suite with BrowserStack Test Reporting & Analytics

Run your test script in the following format:

Terminal
Copy icon Copy

Post build run completion, you will see the build URL of Test Reporting & Analytics in your console. Alternatively, you can also navigate to your build run using Build Runs.

Visit Test Reporting & Analytics

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle