WebdriverIO offers a tight integration to CI systems like Bamboo. With the JUnit or Allure reporter, you can easily debug your tests as well as keep track of your test results. The integration is pretty easy.
- Install the JUnit test reporter:
$ npm install @wdio/junit-reporter --save-dev)
- Update your config to save your JUnit results where Bamboo can find them, (and specify the
Note: It's always a good standard to keep the test results in separate folder than in the root folder.
The reports will be similar for all the frameworks and you can use anyone: Mocha, Jasmine or Cucumber.
By this time, we believe you have the tests written up and results are generated in
./testresults/ folder, and your Bamboo is up and running.
Open your Bamboo project
Create a new plan, link your repository (make sure it always points to newest version of your repository) and create your stages
I will go with the default stage and job. In your case, you can create your own stages and jobs
Open your testing job and create tasks to run your tests in Bamboo
Task 1: Source Code Checkout
Task 2: Run your tests
npm i && npm run test. You can use Script task and Shell Interpreter to run the above commands (This will generate the test results and save them in
Task: 3 Add jUnit Parser task to parse your saved test results. Please specify the test results directory here (you can use Ant style patterns as well)
Note: Make sure you are keeping the results parser task in Final section, so that it always get executed even if your test task is failed
Task: 4 (optional) In order to make sure that your test results are not messed up with old files, you can create a task to remove the
./testresults/folder after a successful parse to Bamboo. You can add a shell script like
rm -f ./testresults/*.xmlto remove the results or
rm -r testresultsto remove the complete folder
Once the above rocket science is done, please enable the plan and run it. Your final output will be like:
Yay!! That's all. You have successfully integrated your WebdriverIO tests in Bamboo.