screenshots
screenshots copied to clipboard
Support of flutter's --dart-define attribute for screenshots command
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?
Yeah, that's a good idea. We're also using dart define variables and I would like to pass them to the screenshots command.