browser of browser.sharedStore is undefined when running tests against electron app
See original GitHub issueEnvironment (please complete the following information):
- WebdriverIO version: [6.4.0]
- Mode: [WDIO Testrunner]
- If WDIO Testrunner, running sync/async: [async]
- Node.js version: [12.18.4]
- NPM version: [6.14.8]
- Browser name and version: [Chrome 86]
- Platform name and version: [macOS Catalina 10.15.7]
- Additional wdio packages used (if applicable): [@wdio/spec reporter, wdio-chromedriver-service, @wdio/sync, @wdio/mocha-framework, @wdio/local-runner, @wdio/junit-reporter, @wdio/dot-reporter, @wdio/shared-store-service]
Config of WebdriverIO services: [‘chromedriver’, ‘shared-store’]
Describe the bug
I have 3 spec files that run consecutively as a single test suite. In before hook of 1st spec I store some data coming from api response such as browser.sharedStore.set('accessToken', accessToken)
and in spec file 3 I am getting that data as
await browser.sharedStore.get('accessToken')
. The problem is that when I run my tests againt electron app (I use spectron ^9.0.0
) the browser becomes undefined since in case of electron app the client is not the browser and this causes error.
To Reproduce
- Create 2 separate spec files
- Make sure in 1st spec file you store some data in sharedStore
- Make sure in 2nd spec file you get that data from sharedStore and use it
- Make sure the tests are running against electron app via spectron library.
- Confirm that code works and the browser is not
undefined
Expected behavior Tests run successfully with stored data.
Log https://gist.github.com/Hayk-S/c911c7bcfa21b59db0d5fab424ce921a
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
You can fork wdio shared store service and make it work in any other framework. As I said, it suppose to work only with webdriverio.
Perhaps a reproducible example might help to understand what is actually going on
Will reopen when shareable code will be under hand