To configure cucumber-js such that it works with Captain, we need to:
- 🧪 Ensure cucumber produces json output
cucumber-js --format json:tmp/cucumber.json
will produce Captain-compatible JSON output in tmp/cucumber.json
.
To ensure GitHub logs continue to have test output, also include a stdout-friendly formatter (for example, --format summary
)
# .captain/config.yaml
test-suites:
captain-examples-cucumber-js:
command: cucumber-js --format json:tmp/cucumber.json --format summary
results:
language: JavaScript
framework: Cucumber
path: tmp/cucumber.json
- 🔐 Create an Access Token
Create an Access Token for your organization within Captain (more documentation here).
Add the new token as an action secret to your repository. Conventionally, we call this secret RWX_ACCESS_TOKEN
.
- 💌 Install the Captain CLI, and then call it when running tests
See the full documentation on test suite integration.
- uses: rwx-research/setup-captain@v1
- run: captain run captain-examples-cucumber-js
env:
RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}
- 🎉 See your test results in Captain!
Take a look at the final workflow!