As of 0.20.1 Cucumber is now fully supported in Protractor but I\'m battling to find any documentation on how to configure it properly. Any idea how you would setup world.js? >
I've gotten good milage from this setup
class ChtWorld
chai = require('chai');
chaiAsPromised = require('chai-as-promised');
constructor: ->
@browser = @protractor = require('protractor').getInstance()
@By = @protractor.By
chai.use(chaiAsPromised)
@expect= chai.expect
module.exports= ->
this.World= (callback) ->
w = new ChtWorld()
callback(w)
Since protractor is already setup, just getting a reference to it is sufficient (note that for Cucumber to correctly load up the new world, the modules.exports has to be just right).
As a side note, this is located in features/support/world.coffee, and not explicitly added to the 'requires' list (trying to do that got me into Gherkin Lexing error problems).