Open AbdelrahmanTalat opened 1 year ago
@AbdelrahmanTalat This is completely unrelated to Shot. The rotation happens, but asynchronously. Therefore, at the moment you take the screenshot, the rotation has not always finished.
The ugly fix for this is to add a Thread.sleep() before taking the screenshot. The cleanest way is to implement a testRule that waits for the recreated Activity in the correpsonding orientation to resume.
I provided such a function in this library, which works with Shot and other on-device screenshot testing libraries: https://github.com/sergio-sastre/AndroidUiTestingUtils
Expected behaviour
When comparing 2 screenshots in landscape mode the test should pass.
Actual behaviour
When comparing 2 screenshots in landscape mode the test fails with the following response.
Steps to reproduce
Version of the library
5.14.1