Skip to content

captain-examples/cucumber-ruby

Repository files navigation

Getting Captain working with Cucumber

Starting from a simple workflow that runs cucumber, we want to

  1. 🧪 Ensure cucumber produces json output

cucumber --format json --out tmp/cucumber.json will produce captain-compatible json output in tmp/cucumber.json. For github logs to continue to have test output, also include a stdout-friendly formatter (--format progess for dots --format pretty for full test names)

bundle exec cucumber \
  --format json --out tmp/cucumber.json \
  --format pretty
  1. 🔐 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.

  1. 💌 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
  env:
    RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}
  1. 🎉 See your test results in Captain!

Take a look at the final workflow!