screenshots
screenshots copied to clipboard
Config validation can be better at telling what is badly configured or missing
I thought I can have the following screenshots.yaml:
devices:
ios:
iPhone SE:
But it doesn't work.
Running screenshots with that file yields stack trace output that is only good for the developer(s) of this lib.
There are no defaults for tests, staging, locales, nor frame.
I would suggest:
- if
devicesis null - let the user know and exit; - if
devices.iosanddevices.androidare null - let the user know and exit; - if
testsis null, then walktest_driverdir (if it exists) and collect*.dart, that do not match*_test.dart; - if
stagingis null, default to/tmp/screenshots(or checkTMPDIRenv and fallback to/tmp/); - if
frameis null, default tofalse(my suggestion, but fine withtruetoo); - confirm all config types afterwards and tell the user if any value is of the wrong type;
- output the values when
-v/--verboseis used; - maybe even add a
--print-configto to print the config as yaml with the defaults.
I could implement these if someone can help me a bit to find the right spot to add the validations/defaults.
@avioli a good place to start may be validate.dart and config.dart