-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Hooks are not waiting for promises with cucumber framework 2.2.8 #3068
Comments
@Tallyb in the meantime this should be a workaround: beforeFeature: function (feature) {
browser.windowHandleSize( {width: 375, height: 800});
console.log('IN BEFORE FEATURE');
browser.call(() => utils.runDelays());
}, |
@christian-bromann I just checked it (also on my real repo previously) and it does not fix. |
Is this confirmed then? I have some failing tests that could be caused by that behaviour |
Seeing the same behavior when attempting to make an axios http POST in Using |
yes it is 2.x version issue. And this should be moved to cucumber adapter repo @christian-bromann For @Tallyb @jonatr35 @rodrigodiez You can achive expected behaviour by using "native" cucumber hooks e.g.:
In this case
For more information see cucumber hooks documentaion |
Thanks @BorisOsipov that is really useful |
Closing this. It will be a requirement for the cucumber v5 effort. |
Hey guys, we have upgraded to v5 and we are observing this issue. Any workarounds for this ? Our first Given is consistently running before our async afterFeature hook has finished and it breaks our tests essentially ... |
Having a look now, thanks @mgrybyk. Sticking a timeout makes thing work but is far from being a good solution |
Environment (please complete the following information):
wdio-cucumber-framework
Bug repo: https://github.com/Tallyb/wdio-test/tree/async-hooks (branch is async hooks)
Config of WebdriverIO
An example of how you configured WebdriverIO config
Describe the bug
BeforeFeature hook is not waiting for promise resolve.
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
https://github.com/Tallyb/wdio-test/tree/async-hooks
npm install
npm run test
install wdio-cucumber-framework in version 1.1.1 to see the desired behaviour. Change to 2.2.8 to see the bug (logging message is showing before the async date logs)
Expected behavior
Feature should only run after beforeHook promise was resolved.
Log
If applicable, add logs to help explain your problem.
Create a gist which is a paste of your full Selenium/WebdriverIO logs, and link them here. Do not paste your full Appium logs here, as it will make this issue very long and hard to read! If you are reporting a bug, always include Selenium/WebdriverIO logs!
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: