question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

browser of browser.sharedStore is undefined when running tests against electron app

See original GitHub issue

Environment (please complete the following information):

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

  1. Create 2 separate spec files
  2. Make sure in 1st spec file you store some data in sharedStore
  3. Make sure in 2nd spec file you get that data from sharedStore and use it
  4. Make sure the tests are running against electron app via spectron library.
  5. 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:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mgrybykcommented, Oct 22, 2020

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

1reaction
Hayk-Scommented, Oct 22, 2020

Will reopen when shareable code will be under hand

Read more comments on GitHub >

github_iconTop Results From Across the Web

webdriverio/webdriverio - Gitter
Hi everyone. I'm using WebdriverIO/Appium for Android automation and have a specific problem. When I run npx wdio, it can't see/read wdio.conf.js. Did...
Read more >
Shared Store Service - WebdriverIO
The idea of the service is to deal with very specific environment setup issues. Please avoid sharing test execution data! Configuration​. Add shared-store...
Read more >
How to detect if running in electron? · Issue #2288 - GitHub
How do I detect in JavaScript whether the App is running inside an electron frame ... they're running in the browser, so use...
Read more >
WebdriverIO:cucumber setup shows error "Cannot read ...
I'm trying to get into testing with webdriverIO cucumber setup and found docs and ... but I keep getting the following error after...
Read more >
mozilla-central: changeset 404661 ... - Mercurial
a/devtools/client/debugger/new/test/mochitest/browser.ini +++ ... (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found