google/EarlGrey

EarlGrey 2.0 - Best practices around testing a single screen in isolation

Killectro opened this issue · 1 comments

Are there best-practices around testing a single screen in the EG 2.0 model? In the 1.0 model it is easy to reach in and construct any UIViewController instance you'd like to be able to test, but without access to the application source it becomes a little less obvious how to accomplish this.

Currently we have tests that effectively are meant to test a single screen but have to navigate through the production app navigation to get there which slows down the tests and sometimes introduces unrelated failures.

The one thought I had was to pass some environment information in from to UI test target and use that to hard-code the presentation of a screen in the app target, but I thought there might be a better approach.

Does the EG team/community or Google have any best-practices for how to test a single screen?

You can create a new screen using GREY_REMOTE_CLASS_IN_APP() as well. Have you tried this?