Reputation: 1597
In the docs it is described how to add multiple detox configs to package.json
When I run the tests with detox --configuration someconfig
, how do I find out the someconfig
parameter in my tests (in someTestSuite.spec.js
)?
Use case: in a test I want to set username and password textinputs based on the config, eg.
await getUNameTextInput().typeText('someUsernameBasedOnConfig');
Thanks.
Upvotes: 1
Views: 1171
Reputation: 7973
There's a non official way of accessing the configuration name, and it may change in the future:
const argparse = require('detox/src/utils/argparse');
const configurationName = argparse.getArgValue('configuration');
Upvotes: 2