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

Orientation when using ActivityScenarioConfigurator with Robolectric does not work #58

Closed sergio-sastre closed 1 year ago

sergio-sastre commented 1 year ago

Describe the bug Since Robolectric supports screenshot testing via Robolectric native graphics, and Robolectric supports ActivityScenarios, this library should work with it for everything except Activities, cause most rules use adb -> work only on devices.

However, although everything works as expected, that does not seem the case with orientation Landscape. That needs to be handled differently when running on the JVM with Robolectric

Environment The setup in which the bug is reproducible:

Expected behavior Orientation also works when using Robolectric

Additional context Using RuntimeEnvironment.setQualifiers("+land") when running on the JVM in setInitialOrientation() fixes the issue

sergio-sastre commented 1 year ago

Fix in 2.0.0-beta02. Use RobolectricActivityScenarioConfigurator or the corresponding rules to avoid that issue