-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support native view screenshot in e2e integration tests #83856
Comments
How will we deal with synchronization issues? |
what is an example of a "synchronization issue" ? |
Making sure the platform view has finished loading/animating before taking a screenshot |
oh I see. If |
Also, at this time we have merged the threads, so the raster and the platform threads are the same. I was looking at the 2s delay described in the public docs. I think if we get the next frame callback from the platform, and the raster and platform threads are merged, we should be able to remove the 2s if wanted to. On Android at least, the only issue is that SurfaceView/SurfaceTextureView aren't synchronized to the Android view hierarchy. |
Is this going to be an API on the Flutter Driver host tools or within the Flutter Driver extension? The latter would be preferable so that it can be reused for |
I added |
oh |
If you want the platform views/keyboards, etc it should work. It doesn't have your "crops the status or action bars if needed" feature, though (not sure how that would work). As long as the same simulator version is used every time to compare goldens you probably don't need to crop it (that's what the scenario app does). I may be missing some additional features though. One thing that would be really nice is for the test itself to be able to trigger screenshots or screen recordings (tap button, screenshot, start screen recording, scroll, stop screen recording, tap button, screenshot), which would maybe would involve a VM service hook the tool responds to? Not sure... |
Right. I think that is the use case that I had in mind. @jiahaog could you please describe how this is set up in internally in terms of dependencies? Could the bazel rule trigger |
We have bugs where we don't show the keyboard when the user focuses a Flutter input, etc. I think that if we can get the keyboard in the actual screenshot, we would have a way of testing that. |
I thought we were getting away from package:flutter_driver towards package:integration_test. Does that affect this at all? |
yep. |
There was a feature request filed for web: #51890. On web, the DevTools protocol can be used, so if we decide to do this, we should ensure that it can work with this protocol too: https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot. cc @yjbanov |
In Google3, Integration Tests / Driver tests do not use the Flutter tool at all, so using
|
Irrespective of google3, we're trying to move away from |
Sounds good. On a separate note, flutter/engine#26602 could use this feature. Once we increase API level coverage, we will be able to ensure that input focus and keyboard interactions work as expected. |
#56591 appears to be a blocker for this. Currently, Gradle test-only dependencies end up in the release APK. cc @jonahwilliams |
I don't see why #56591 would be a blocker - assuming you're already using the integrtion_test package then you already have that problem? |
Right. The release APK contains test-only dependencies as seen below. AGP has a configuration ( |
A lot of related issues are locked: #25306 Do we have any progress here? |
@Sunbreak this is actively being worked on. |
Hey, we are looking to take screenshots of camera view using screenshot plugin but are unable to do so because of this issue. Are there any updates on this? Thanks for all the work and amazing framework! |
https://github.com/flutter/flutter/tree/master/packages/integration_test#screenshots @blasten do you know what is still needed for this feature? |
This is functional on Android. As far as Android support is concerned, this is done. We are tracking another issue #97853 about adding tests that need this e2e screenshot functionality. @Pulkit07 what issue did you run into? |
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 bug, including the output of |
Integration tests currently returns a Skia raster image.
This is fine for Flutter widgets, but it misses platform views.
As a result,
customer: money
or dream cannot test platform views.Plugins like
google_mobile_ads
cannot have their own driver teststhat ensure that the native view is sized properly, etc...
We also happen to have the scenario app in the engine, which has
a workaround for this limitation. This workaround breaks occasionally,
and doesn't work with Skia Gold.
For all of these issues, I propose adding a new API to Flutter drive that takes the
device's screenshot and crops the status or action bars if needed
(This will be required on Android if adb is used).
cc @dnfield, @xster, @jmagman for iOS too.
Related bug: http://b/180715355
The text was updated successfully, but these errors were encountered: