oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
322 stars 523 forks source link

[Investigate] Does Robolectric performing Orientation change correctly #2277

Open anandwana001 opened 3 years ago

anandwana001 commented 3 years ago

Describe the bug Orientation change is not behaving correctly in robolectric test cases.

Expected behavior Need to investigate this and see if can have a better approach or modifying the current one.

FareesHussain commented 3 years ago

I've been trying to solve this I've found some references regarding this

BenHenning commented 3 years ago

Changing qualifiers should work. I have a PR coming soon that introduces a general-purpose utility to handle orientation changes for both Robolectric + Espresso.

BenHenning commented 3 years ago

Also for posterity: we can't use ActivityController since it's Robolectric-specific (which means it stops us from being able to write tests that run on both Robolectric & Espresso). We actually can't even compile the tests for Espresso if they use these Robolectric dependencies (by design--Espresso tests can't have two different Android implementations of classes to use).