sergio-sastre / AndroidUiTestingUtils

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

ActivityScenarioForActivityRule flakiness when reseting values like orientation #30

Closed sergio-sastre closed 1 year ago

sergio-sastre commented 1 year ago

Describe the bug When setting values like orientation via ActivityScenarioActivityRule, sometimes they are not reset properly. This means, for example, that the next test might start with use the wrong orientation, and its snapshot would be in the wrong orientation, e.g.Landscape instead of Portrait.

It seems this happens because the activityscenario.close() method is not called once the test finishes.

Environment The setup in which the bug is reproducible:

Expected behavior All values should be reset when the test finishes