Shared Store Service
Exchange data between main process and workers (specs).
#
InstallationThe easiest way is to keep @wdio/shared-store-service
as a devDependency in your package.json
.
You can simple do it by:
Instructions on how to install WebdriverIO
can be found here.
#
UsageGet/set a value (plain object) to/from the store by key (string).
browser.sharedStore.set('key', 'value')
set value to store
browser.sharedStore.get('key')
get value from store (returns 'value'
)
IMPORTANT! Every spec file should be atomic and isolated from others specs. The idea of the service is to deal with very specific environment setup issues. Please avoid sharing test execution data!
#
ConfigurationJust add shared-store
to services list and the sharedStore
object will be accessible to you in your test.