Closed rob-mur closed 1 year ago
Hi! Thanks for opening your first issue here! :smile:
As mentioned earlier, you may do this by disabling or porting some functionalities.
Looking forward to your PR :)
Done some more research and the current culprit seems to be that the GoldenComparator is unsupported for Web. I noticed this from the documentation of goldens_web in flutter and seems to track from here - there seems to be some difficulty getting consistent screenshots in flutter web.
The file in question can be seen in flutter\packages\flutter_test\lib\src_goldens_web.dart and the telling docstring is the following description of LocalFileComparator
/// An unsupported [GoldenFileComparator] that exists for API compatibility.
class LocalFileComparator extends GoldenFileComparator {
I'm assuming that your library heavily uses these comparators for checking the correctness of widgets? If that is the case then I think this issue would be blocked by that upstream problem.
That is optional feature. If you never compare goldens when you use the convenient_test then it is no problem to remove it :) (But I personally use it a lot)
As you'll see in my initial investigation above, it looks like the only supported way to run integration tests on flutter web at the moment is through flutter drive and something like ChromeDriver. This seems like a pretty big obstacle at the moment to getting this working.
I think our current options to recommend are either:
Let me know if you have other ideas - you are much more experienced than I am.
This tool is based on integration test. So maybe we can do this:
So I think the problem is that only flutter drive is supported, which acts a bit like flutter test in that is just runs through the tests once with no way to communicate with the manager.
Potentially the manager could have some option added that allows it to call this command in a directory to get a visual report of the tests passing/failing.
I think you would still need ChromeDriver however.
Currently if you did flutter run, there's an error about frames being painted, even with goldens removed. You can check it out in my fork if you like - just need to make sure you're on master version of flutter (doesn't work at all on stable, see issue in the fork)
IMHO convenient_test consists of several parts. One part is that manager drives worker, but that part may be removed for web.
That's a good idea. We could try to at least keep the same code as used for the other devides' tests (or as close as possible), that can then be run with flutter drive.
I'll take a look at that when I'm next working on it!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Is your feature request related to a problem? Please describe. Currently (as far as I know) this tool doesn't work with web builds - which would be cool functionality to have. The current error message if you just tried to do this today is:
Describe the solution you'd like Ideally something similar to what exists for other platforms (just flutter run with some args), although remains to be seen if its possible with web.
Describe alternatives you've considered The alternative would be to just run your integration tests on say a large format desktop platform (windows/mac/linux) and hope that there's nothing web specific that breaks your app. Honestly this is probably fine, but would be cool to investigate this to see.
I haven't yet read through your contribution docs/general design but will take a look when I next get some time to see how this is approached.