Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

"Error in onReload hook" using reload method on update framework version #158

Open
xiscocapllonch opened this issue Dec 28, 2018 · 5 comments

Comments

@xiscocapllonch
Copy link

xiscocapllonch commented Dec 28, 2018

I'm using WebDriverIO and cucumber with the test runner to run tests that need an special clean scenario environment without old cookies or session storages.

I was using the "browser.reload()" method in the "beforeScenario" function without any problem for the next set of versions:

"cucumber": "4.2.1", "wdio-cucumber-framework": "1.1.1", "webdriverio": "4.13.0"

When I updated the wdio-cucumber-framework version form "1.1.1" to "2.2.8", the beforeScenario function:

beforeScenario: function () { browser.reload() }

Throws an exception like the following:

Error in onReload hook: "Error: Don't call the 'init' command when using the wdio test runner. Your session will get initialised and closed automatically.

And "Your session will get initialised and closed automatically" isn't the case between scenarios.

@xiscocapllonch
Copy link
Author

Someone?

@BorisOsipov
Copy link
Contributor

@xiscocapllonch please share repo with reproducible example, I will try to help

@xiscocapllonch
Copy link
Author

@BorisOsipov thanks, you can try with this example https://github.com/xiscocapllonch/wdio-cucumber-reproducible-example

@BorisOsipov
Copy link
Contributor

@xiscocapllonch didn't get what is happened. Workaraund move browser.reload() to cucumber hook.
E.g see patch https://gist.github.com/BorisOsipov/2755ee4e121d2628f71b6f5750405225

@BorisOsipov
Copy link
Contributor

Also if you use sync:true you don't need async\await e.g await browser.waitForExist('#bbcprivacy-continue-button')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants