View build reports in CircleCI
Publish your Test Reporting & Analytics build report to the CircleCI job log and artifacts using the BrowserStack CircleCI orb.
The BrowserStack CircleCI orb fetches your Test Reporting & Analytics build report at the end of a job. The orb prints a plain text summary to the job log and uploads the full HTML report to the job’s artifacts, so you can review results without leaving CircleCI.
Prerequisites
Before you start, ensure that:
- You have a BrowserStack Test Reporting & Analytics account, and your tests already report build data to it.
- Your BrowserStack Username and Access key are set as CircleCI project environment variables named
BROWSERSTACK_USERNAMEandBROWSERSTACK_ACCESS_KEY. You can also set them underenvironmentin the job. - A CircleCI personal API token is set as a project environment variable named
CIRCLECI_TOKEN. - Your organization allows uncertified orbs in Organization Settings > Security.
The set_browserstack_config command calls the CircleCI API to read the current workflow, so CIRCLECI_TOKEN is required even if you set your BrowserStack credentials inside the job. Without it, the command stops and no report is generated.
Add the BrowserStack orb to your config
Add the orb to your .circleci/config.yml file, then add the two BrowserStack commands after the step that runs your tests:
The commands do the following:
| Command | Description |
|---|---|
set_browserstack_config |
Reads your credentials, generates a build name as circleci-<workflow-name>-<build-number>, and exports it as BROWSERSTACK_BUILD_NAME for the steps that follow. |
test_reports |
Polls Test Reporting & Analytics for the build report, prints the plain text version to the job log, and stores the HTML version as an artifact. |
Add set_browserstack_config before the step that runs your tests, and test_reports after it. The config command generates the build name that test_reports uses to look up the build in Test Reporting & Analytics.
The user_timeout parameter specifies the maximum time, in seconds, before the test_reports command times out while retrieving the report. If omitted, the default value is 130 seconds.
View the build report
Commit your changes and run the pipeline. When the job finishes, you can view the report in two places:
- Job log: expand the Show & Upload Report step to read the plain text summary, which lists the build status and the test counts.
- Artifacts: open the Artifacts tab of the job and select the Browserstack Test Report artifact to open the full HTML report with charts and test-level detail.
Rerun failed tests
You can rerun failed tests from the Test Reporting & Analytics dashboard after you integrate CircleCI. For the steps, see Rerun tests on CircleCI.
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!