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

browser.reload() failing to reload the session when this was called after a failed test #20

Open
christian-bromann opened this issue Feb 26, 2019 · 1 comment

Comments

@christian-bromann
Copy link
Contributor

From @nareshnayini on February 26, 2019 18:19

I am encountering issues when trying to use reload after every test when preceding test fails.

Environment:

  • WebdriverIO version: 4.13.2
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: async
  • Node.js version: 10.5.0
  • NPM version: 6.1.0
  • Browser name and version: Chrome 69
  • Platform name and version: macOS 10.13.5
  • Additional wdio packages used (if applicable): * wdio-jasmine-framework

Describe the bug
When a test fails, browser.reload() function inside afterTest failing with the below mentioned error. So, browser session is not deleted and it's reloading with session session.

To Reproduce
Steps to reproduce the behavior:
WDIO config:
afterTest: () => {
browser.reload();
},
afterSession: async () => {
await browser.end().pause(1000);
},
after: async () => {
await browser.pause(1000);
},

Expected behavior
It is expected that, upon reload() call, user will be logged out from application and application relaunches.

Log
Error in onReload hook: "Error: Don't end the session manually. This will be done automatically.
at session("delete") - end.js:31:17
at init() - reload.js:40:23
at end() - reload.js:40:17
at screenshot() - saveScreenshot.js:52:17
at reload() - index.js:312:3"

I have looked into other tickets related to this issue but nowhere found the solution. Most of the tickets were closed saying they are inactive.

Copied from original issue: webdriverio/webdriverio#3634

@CrispusDH
Copy link

Move reload to beforeTest :)

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

2 participants