Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
unhandled exception running `screenshots` #6
Hi @mmcc007 ,
I've followed your docs / repo / article and am not able to get screenshots to generate from my flutter driver tests. I keep getting the following error when running from my project and also from your screenshots repo:
Did I miss a step about creating a directory somewhere?
Really looking forward to getting this package working both in our local workflow and in Travis CI.
my flutter doctor output:
also running into issues installing packages from your
It looks like it cannot find the 'emulators' command in the PATH. So adding it to your PATH should probably fix it.
When it is in the path the command
should work from the command line. Screenshots will then find it also.
To get the example working with Flutter v1.2.1 (the latest), in example/pubspec.yaml change:
and upgrade using:
Running Screenshots on Travis (or on most build providers) requires running the correct Android emulators. Since, in general, it is not possible to run emulators with hardware acceleration in the cloud and because Google no longer supports Arm emulators, it won't be possible to run emulators for more recent android devices in the cloud... and the emulators for the older devices you manage to get started will run painfully slow and may not provide predictable graphics behavior.
In general, you have to go with third party accelerated emulator providers, like SauceLabs, Genymotion, etc... (or run your own build server in-house, like GitLab, Jenkins, etc...)
For an example of running Genymotion on Travis see:
At some point in the future, I will add an example of running Screenshots in Fledge running on an in-house GitLab. Fledge is a CI/CD tool for Flutter. For details on Fledge see:
iOS simulators do not suffer from this problem (though run slower in the cloud).
Oh, hey Mike, so to answer your question more clearly, you should now have no problem running Screenshots on your desktop.
Running automatically on a build server (like Travis) is definitely a good thing to do. This is more in the domain of CI/CD which is why I recommend Fledge (https://github.com/mmcc007/fledge) for that or whatever CI/CD solution your prefer.
Let me know if you have any other questions and thanks for using Screenshots
Thanks for the responses Maurice, I'll give this another try. I've followed your other Travis config for Flutter CI/CD pipeline and that worked well, however we need to be able to use the current emulators for screenshot automation so will be doing that locally or will possibly consider the third-party providers you mentioned. We are also interested in trying Fledge as well. Your Medium articles have been helpful and it will be nice to see the Flutter dev workflow tooling proliferate. I'll close this issue and re-open if I run into any other troubles with
Thanks for the kind words!
BTW: another potential option is to consider using real devices in the cloud.
I have been able to automate running integration tests on AWS Device Farm (real devices.. though may get pricey).
So far it runs on android. Working on seeing if it works on iOS.
If running integration tests works on Device Farms for android and iOS, I'll setup a demo. That would then be another option for running Screenshots (and Fledge for that matter)
...may try the same for SauceLabs (they have emulators and real devices too)
No problem, your efforts are helping us all so it's definitely appreciated
Have you tried out Kobiton's Mobile Testing Platform? Looking into everything at the moment to improve workflow and stability long-term on our new app, but currently screenshots are the priority to get our store submissions completed asap. Round 2 will be to shore up the workflow automation and make it all shiny / happy.
Definitely curious to see if your device farm automation works out (and potential demo)
I was able to get
Haven't worked with Kobiton yet, but they seem to have a stack that intersects with BrowserStack, SauceLabs, Device Farm as far as real devices via Appium tooling goes. All of these require at least workarounds to work with Flutter and some may not work at all.
I have talked to SauceLabs and AWS Device Farm (just had an hour-long conversation with one of AWS's Systems Architects on Friday) so far. I have been experimenting with the Device Farm API.
Beyond the scope of Screenshots, as in, in a CI/CD context, ie, Fledge, I have, as mentioned, got a very complete solution for running integration tests on android with AWS Device Farm... so that's good. But when/if I can get it working on iOS then we're talking significant progress.
(BTW: Eric Siedel, the creator of Flutter, and the Flutter team lead, has even chimed-in, saying he, as well as other members of the Flutter Team, is "very interested" in what I might get working on AWS Device Farm!)
As far as your last post:
Screenshots expects no emulators/simulators or real devices to be running when it starts (I should probably check for that on start-up). So it may be getting confused about initial conditions (Flutter tooling may be contributing to this confusion). Make sure no emulators/simulators are running when Screenshots starts (and no devices connected... Screenshots will need more code to work correctly with all real devices).
(You might want to file a separate issue about support for real devices if this is something you want, so it can be tracked... in fact, feel free to file separate issues about any individual bugs or features as you see fit for Screenshots and Fledge, so they can be handled individually and tracked... your feedback is welcome and is used to guide where development effort is focused)
The three scripts you mention are used to start/stop and set locales (note: locales are not fully supported by Flutter tooling) for android emulators and iOS simulators.
Hope that helps!