screenshots icon indicating copy to clipboard operation
screenshots copied to clipboard

Support of flutter's --dart-define attribute for screenshots command

Open sderungs99 opened this issue 5 years ago • 1 comments
trafficstars

Flutter allows to pass in command arguments via the --dart-define attribute (see https://itnext.io/flutter-1-17-no-more-flavors-no-more-ios-schemas-command-argument-that-solves-everything-8b145ed4285d for more details).

It will be good if the screenshots command would allow to use a similar attribute, which will then be passed to the tests defined in the screenshots.yaml configuration file.

Right now, I am writing the --dart-define attributes directly into the screenshots.yaml file, like so: tests:

  • --target=test_driver/app.dart --driver=test_driver/app_test.dart --dart-define=SECRET_API_KEY=<MY_VERY_SECRET_API_KEY>

Rather than having this secret key in the screenshots.yaml file (which is checked into version control and therefore visible to everyone), it would be nice if I could use this attribute when calling the screenshots command, for example: screenshots -df=SECRET_API_KEY=<MY_VERY_SECRET_API_KEY>

Would be great if this can be added, or maybe there is a different way to do this already?

sderungs99 avatar Jul 25 '20 06:07 sderungs99

Yeah, that's a good idea. We're also using dart define variables and I would like to pass them to the screenshots command.

devjeff avatar Feb 16 '21 16:02 devjeff