sergio-sastre / AndroidUiTestingUtils

A set of TestRules, ActivityScenarios and utils to facilitate UI and screenshot testing under given configurations: FontSizes, Locales...
MIT License
290 stars 14 forks source link

setOrientation in Activity not always rotating back on API 31 once the test finished #4

Closed sergio-sastre closed 2 years ago

sergio-sastre commented 2 years ago

Describe the bug setOrientation in Activity: when using it, it does not rotate back to the initial orientation after the test finished. That means, the next tests might start with the wrong orientation.

Environment The setup in which the bug is reproducible:

Expected behavior After the test where we use setOrientation finishes, the layout orientation returns to the one before the test started.

Reproducible sample Run Road to effective snapshot testing on API 31.

sergio-sastre commented 2 years ago

This only happens if not calling activityScenario.close() at the end of the corresponding tests.