Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow all settings to be defined without cli arguments #1306

Closed
cs01 opened this issue Apr 18, 2019 · 8 comments
Closed

allow all settings to be defined without cli arguments #1306

cs01 opened this issue Apr 18, 2019 · 8 comments

Comments

@cs01
Copy link
Contributor

cs01 commented Apr 18, 2019

Is your feature request related to a problem? Please describe.
Some arguments, such as loglevel or cleanup, can only be defined as CLI arguments, which forces the user to use the detox-cli. While the detox cli is very convenient, we are integrating detox into a toolchain that cannot use it, yet still want to modify these parameters.

Describe the solution you'd like
The option to pass all configurations values as optional parameters to functions.

The order of preference would be:

  • default value
  • parameter value (overrides default)
  • cli value (overrides parameter)

Alternative solution
In cases where it's impractical to pass the arguments, an environment variable could be used.

@LeoNatan
Copy link
Contributor

Let's follow this in #1238 as they seem to discuss the same subject.

Issues Triage automation moved this from Accepted to Closed Apr 18, 2019
@cs01
Copy link
Contributor Author

cs01 commented Apr 18, 2019

I noticed #1238 references this issue in the last checkbox, so @noomorph should either remove that reference or this issue should be re-opened. FWIW I think it makes sense to reopen this issue to separate concerns. Commits can be tagged with this issue number rather than the catch-all issue of #1238, but that is just my two cents 😄. Either way, thanks for your quick responses, much appreciated.

@cs01
Copy link
Contributor Author

cs01 commented Apr 19, 2019

Just wanted to note that all command line arguments will fall back to checking for the equivalent camel-cased environment variables. (see detox/src/utils/argparse.js)

@noomorph
Copy link
Collaborator

noomorph commented Nov 7, 2019

With #1729, we added all artifacts collection options to Detox's package.json section.

@noomorph
Copy link
Collaborator

noomorph commented May 9, 2020

With #2038, --reuse and --cleanup CLI options can be used via detox.behavior object in package.json.

@noomorph
Copy link
Collaborator

Currently, I am planning to add support for:

  -H, --headless            [Android Only] Launch emulator in headless mode. Useful
                            when running on CI.                               [boolean]
      --gpu                 [Android Only] Launch emulator with the specific -gpu [gpu
                            mode] parameter.
      --device-launch-args  Custom arguments to pass (through) onto the device
                            (emulator/simulator) binary when launched.
      --force-adb-install   Due to problems with the "adb install" command on Android,
                            Detox resorts to a different scheme for install APK's.
                            Setting true will disable that and force usage of "adb
                            install", instead.               [boolean] [default: false]

Will post soon a link to a WiP PR.

@d4vidi d4vidi removed this from Needs triage in Issues Triage Oct 3, 2021
@d4vidi d4vidi added this to the Q4/2021 Bugathon milestone Oct 3, 2021
@d4vidi
Copy link
Collaborator

d4vidi commented Oct 3, 2021

@noomorph can this be closed, then?

@noomorph
Copy link
Collaborator

@d4vidi, yeah, let's close it.

@d4vidi d4vidi removed this from the Q4/2021 Bugathon milestone Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants