Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when migrating from 1.0.0 to 1.2.0 #601

Closed
vytautas-pranskunas- opened this issue Jun 29, 2016 · 12 comments
Closed

Issue when migrating from 1.0.0 to 1.2.0 #601

vytautas-pranskunas- opened this issue Jun 29, 2016 · 12 comments

Comments

@vytautas-pranskunas-
Copy link

Hello,

after cucumber version was updated i run into an issue and do not exactly understand how to fix it:

cucumber event handlers attached via registerHandler are now passed the associated object instead of an event
getPayloadItem will be removed in the next major release

C:\dev\Topic Analyst\Frontend\node_modules\cucumber\lib\cucumber\runtime\event_broadcaster.js:30
throw error;
^
function accepts a callback and returns a promise

0 passing (3.30s)

[10:43:31] 'cucumber' errored after 3.51 s
[10:43:31] Error in plugin 'gulp-webdriver'
Message:
wdio exited with code 1

Any idea? Is this gulp-cucumber issue or...?

@skadeglad
Copy link
Contributor

this is cucmber:

in one of your hooks or steps you've put a callback as a function parameter and then didnt call it:
e.g.

this.Before(function(scenario, callback) {
return something();
});

so if you return a promise, just get rid of "callback" as a parameter => function (scenario) {...}
or
just use your callback at the end: callback()

@vytautas-pranskunas-
Copy link
Author

no, we are not doing anything like that, instead we are hooking to gulp-cucumber ''beforeFeature" hook. This might be an issue. gulp-cucumber uses callback i suppose?

@skadeglad
Copy link
Contributor

can you provide your beforeFeature code?

@vytautas-pranskunas-
Copy link
Author

You can find it on:

https://github.com/vgamula/gulp-cucumber

@charlierudolph
Copy link
Member

Can you get gulp to print a stacktrace? That way we might be able to nail down where the offending code is. The one recent change is now that registerHandler will throw a similar error as to what is described by @skadeglad.

@vytautas-pranskunas-
Copy link
Author

I am afraid but this is all stack trace I see :(

@charlierudolph
Copy link
Member

I believe the error is in https://github.com/webdriverio/wdio-cucumber-framework

@charlierudolph
Copy link
Member

@vytautas-pranskunas- can this be closed? Appears wdio-cucumber-framework has been updated

@vytautas-pranskunas-
Copy link
Author

Yes. Thanks

@iongion
Copy link

iongion commented Nov 15, 2016

Using cucumber-js 1.3.1, I get this warning:

cucumber event handlers attached via registerHandler are now passed the associated object instead of an event
getPayloadItem will be removed in the next major release

My hooks are:

var Hooks = function() {

  this.BeforeFeature(function (event, callback) {
    Context.feature = event.getPayloadItem('feature');
    callback();
  });

  this.BeforeScenario(function (event, callback) {
    Context.scenario = event.getPayloadItem('scenario');
    callback();
  });

  this.BeforeStep(function (event, callback) {
    Context.step = event.getPayloadItem('step');
    callback();
  });

};

What do I need to change ?

@aluzardo
Copy link

aluzardo commented Nov 15, 2016

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants