android / testing-samples

A collection of samples demonstrating different frameworks and techniques for automated testing
Apache License 2.0
9.19k stars 3.61k forks source link

ScreenshotTestSample with Gradle Manged Devices and several shards generates screenshots for last shard only #502

Open sergio-sastre opened 9 months ago

sergio-sastre commented 9 months ago

If I run ./gradlew nexusOneApi30DebugAndroidTest -Pandroid.experimental.androidTest.numManagedDeviceShards=2

I see the following in the terminal:

Task :app:nexusOneApi30DebugAndroidTest Starting 4 tests on nexusOneApi30_0 Starting 2 tests on nexusOneApi30_1

And then in the build folder only the screenshots for shard 1 are generated: those from shard 1 are missing:

Screenshot 2024-01-06 at 09 14 51

Remarks: I've executed the command several times. Sometimes the first shard is assigned 2 tests, and the second 4, sometimes the first is assigned 4 and the second one 2. In both cases, only the screenshots of the second shard are generated in the corresponding folder

Expected: The screenshots of all shards are generated in the corresponding folder