Reputation: 270
Is it possible to generate test golden files(images) when running an integration test in Flutter?
I'm able to generate the golden files when I run flutter test --update-goldens
which happens not to run the integration test.
My main aim is being able to generate the test golden files(images) from an Android emulator when the integration test is running.
I tried running flutter test integration_test/app_test.dart --update-goldens
but unfortunately, I got this error about having Read-only access permission:
Then I tried granting a READ and WRITE access permission using the flutter driver
:
But unfortunately, Flutter driver skipped the process of generating or comparing the test golden file(image) when I run flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart
:
The full source code is available HERE
Upvotes: 9
Views: 1543
Reputation: 21
The option above for flutter test integration_test/app_test.dart --update-goldens
now appears to work. I successfully ran it on a Windows project for a Windows Target. I ran it in the Terminal Tab/Window of Android Studio Hedgehog. I ran it from the project root and explicitly named my integration test file as shown above. It generates the golden files and the failure folder in the integration_test folder. I believe this question can be closed. DM me for deets.
Upvotes: 1