Closed ra9r closed 5 years ago
I may have figured this out ... very confusing setup requirements with the changes between versions. Near as I can tell I was using a combination of syntax, and not all was correct for the latest. Here is how the step_definitions.js
file had to change ...
var {defineSupportCode} = require('cucumber');
defineSupportCode(function({Then, When, Given, Before, After}) {
Before(function (scenario) {
this.actionwords = Object.create(require('./actionwords.js').Actionwords);
});
After(function (scenario) {
this.actionwords = null;
});
Given('I select the song {string}', function (song_name, callback) {
this.actionwords.iSelectTheSongSongName(song_name);
callback();
});
Given('I see the lyrics', function (callback) {
this.actionwords.iSeeTheLyrics();
callback();
});
Then('I can sing the song', function (callback) {
this.actionwords.iCanSingTheSong();
callback();
});
});
Unfortunately @ra9r, CucumberJS 3.0+ isn't supported. The 2.2 release works with CucumberJS 2.2 and the plan would be to release maj.min
releases to support that same version of CucumberJS because its API changes quite a lot between releases.
Has work already began to support cucumber-js 3? We're using that version with this lib, currently casting like @given('{string} clicks the button on tile for account {int}' as any)
to use Cucumber Expressions
I may try and pick this up in the new year. CucumberJS moves on much quicker than I can keep up though, but I'll do my best. I'm happy to accept PRs too.
cucumber-js
is now at version 4.2.1. Any plans to update cucumber-tsflow
to support version 4? FWIW, I see there's a much simpler (less feature-rich) FlippieCoetser/Cucumber.Decorators
project that supports Cucumber version 3 and version 4 which may provide some guidance on the updates needed to cucumber-tsflow
.
@KeithGillette absolutely! Coming soon 🙂 FYI we’re currently using this lib with cucumber 3. It technically isn’t on the supported list but it absolutely works as is. We just ignore the version warning that npm gives 😬 have you tried to see if it just works with v4 yet?
Awesome, @mikehaas763! I just tried and as soon as I figured out how to change our protractor.cucumber.conf.js
cucumberOpts:
to no longer use format: ['pretty']
it turns out that our tests worked fine with cucumber-tsflow
and cucumber-js@4.2.1
. I was already ignoring the DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
, so also ignoring DeprecationWarning: cucumber: defineSupportCode is deprecated. Please require/import the individual methods instead.
is not too big of a deal. Thanks!
When running CucumberJS v3.0.1 on the command line without any parameters; and given the following project assets/directories ...
karakoke.feature
step_definitions.js
actionwords.js
When I run the above using any of the following commands ...
I get this error ...
What am I doing wrong? I am using the correct expression syntax for version 3.x ... what else can I try?