Interested to see thoughts around using a custom D...
# android
a
Interested to see thoughts around using a custom DSL for implementing the UI test robot pattern. Basically, in liu of a java-esqe Builder like ScreenRobot().userName("user").password("pass").build() you could instead define a structure
Copy code
robotTest {
   screenRobot{
     precondiitons{
       userName = "user"
       password = "pass"
     }
     verify{
       errorisShown()
     }
   }
}
@bajicdusko looks like you've done this 2 years ago(https://github.com/codecentric/androidtestktx). Did you having success using it?
p
With
androidx.test
you can use Espresso in unit tests. We have our page objects (screens / robots) in their own "sharedTest" source set, so they can be used from Robolectric unit tests too, along with common data setup code. The on-device android tests (the "what") are separated from the screens (the "how"). The pattern has worked well for us overall.