Using Cucumber with Adonis?


#1

Hi,

Has anyone tried using Cucumber with Adonis? I would like to use the ApiClient to test a REST API, but I’m not sure how to get to it.

app/Commands/Cucumber.js:

const {Command} = use('@adonisjs/ace')
const {Cli} = use('cucumber')

class Cucumber extends Command {
  static get signature() {
    return 'cucumber'
  }

  static get description() {
    return 'Run cucumber-js'
  }

  async handle(args, options) {
    const cli = new Cli({
      argv: ['node', 'cucumber-js'],
      cwd: '.',
      stdout: process.stdout
    })
    cli.run()
      .then(() => process.exit(0))
      .catch(() => process.exit(1))
  }
}

module.exports = Cucumber

feature/support/setup.py:

const { Before } = use('cucumber')

Before(function () {
  this.client = ???
})