Closed mateuszkwiecinski closed 9 months ago
How big is the screenshot you are taking?
I don't know how big the screenshot I take is, but I can share it fails here: https://github.com/facebook/screenshot-tests-for-android/blob/cdb5bd36b9be745bb3ba3378bf102815d2165144/core/src/main/java/com/facebook/testing/screenshot/internal/ScreenshotImpl.java#L206
so the plugin starts misbehaving when captured screenshot has more than:
public static final long DEFAULT_MAX_PIXELS = 10000000L;
so 2000x5001px would fall into the scenario I described
Ok so then the issue is not on our side 😢 I'm afraid there is nothing we can do to fix this issue. I'm closing it for now. Thanks for reporting @mateuszkwiecinski
I think it is 100% on the Shot's side 🤔 I mean facebook's library allows to configure the maximum screenshot size (and not to rely on the default value I linked). I claim Shot plugin should also expose such ability.
Also, the behavior where plugin fails silently which leads to false positives is also something needs fixing. That's a clear bug to me which makes the plugin unreliable 👀 Failing screenshot should always fail the build, no?
Ok, I get what you mean now. I'm going to open the issue again and update the description to specify that the change we should implement is to let configure the max screenshot size instead of relaying on the default value. Thanks for the clarification btw. The catch preventing Shot to crash when this happens is a different bug I think you've already reported. Thanks for the info, I really appreciate it.
@nrotonda fixed the issue and I'll release the fix with Shot 6.1.0
Expected behaviour
It seems like I stumbled upon 2 issues at once, but the behavior I expect is:
Actual behaviour
If someone doesn't expect changed screenshot, or trusts the verification task such behavior can easily sneak in an unwanted behavior change.
Steps to reproduce
./gradlew executeScreenshotTests -Precord
./gradlew executeScreenshotTests
The workaround for this particual issue is to use facebook library directly to capture the view.
Version of the library
5.11.2