This repository is being created to assist client(s) to generate and upload xml reports to existing JUnit XML Uploader feature available on Observability
Run this command in your workspace terminal
go get github.com/browserstack/go-xml-reporter
After installation is successful, you can verify the installation in your go.mod file like this
module your-module
go 1.22.2
require (
...
github.com/browserstack/go-xml-reporter v1.0.0 // version might differ as per your installation
)
For complete usage, refer this example file. example.go
Before getting started, ensure that you have installed the following requirements:
- Go (v1.22.2)
Follow the steps below to set up the repository on your local machine:
-
Fork the repository:
https://github.com/browserstack/go-xml-reporter.git
-
Clone the forked repository:
git clone https://github.com/<---your-github-username--->/go-xml-reporter.git
-
Navigate to the Repository:
cd go-xml-reporter
-
Checkout to the main branch (or any branch of your choice):
git checkout main
-
Install Dependencies
go mod tidy
-
Create a
.env
fileAdd the following snippet to your .env file and replace the values with your actual credentials:
BSTACK_USERNAME=<---YOUR_BROWSERSTACK_USERNAME---> BSTACK_PASSWORD=<---YOUR_BROWSERSTACK_PASSWORD--->
-
To get your username and password in your BrowserStack account, visit this page. (Note: You must be logged in to get your credentials.)
-
Run the main Go file:
go run main.go
This will upload a JUnit XML report to your BrowserStack's Test Observability product.
-
Feel free to customize the values in the example.go file located inside the example folder according to your requirements. After making changes, you can rerun the command mentioned above to test different scenarios.