You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to store environment-specific variables into shared store in onPrepare before running all tests and retrieve from each test's worker process, as documented at README.md. But val is always undefinedunless we put await setValue('hello', 'world') in before().
await setValue('hello', 'world'); // set in onPrepare()
const val = await getValue('hello'); // get in each test
What is your expected behavior?
After setting values through shared store in onPrepare, all workers should be able to retrieve from the shared store.
yunj
changed the title
[🐛 Bug]: shared-store-service setValue does not work at onPrepare()
[🐛 Bug]: shared-store-service setValue does not work in onPrepare() as documented
Oct 22, 2021
Hi @christian-bromann thanks for your reply. My code snippet shows await is being used to call setValue() otherwise it didn't work either in before() as described in the request. We want to do in onPrepare() so only execute once and can be accessed by all tests.
WebdriverIO Version
7.16.0
Node.js Version
16.4.2
Mode
WDIO Testrunner
Which capabilities are you using?
What happened?
We want to store environment-specific variables into shared store in
onPrepare
before running all tests and retrieve from each test's worker process, as documented at README.md. Butval
is alwaysundefined
unless we putawait setValue('hello', 'world')
inbefore()
.What is your expected behavior?
After setting values through shared store in
onPrepare
, all workers should be able to retrieve from the shared store.How to reproduce the bug.
Relevant log output
Return
undefined
when getting the value through a key,await getValue('hello')
.Code of Conduct
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: