Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Sharing (tests) is caring ❤️

Sharing (tests) is caring ❤️

Roberto Orgiu

March 26, 2019
Tweet

More Decks by Roberto Orgiu

Other Decks in Programming

Transcript

  1. android { ... sourceSets { String sharedTestDir = 'src/sharedTest/java' test

    { java.srcDir sharedTestDir } androidTest { java.srcDir sharedTestDir } } } What happens in build.gradle stays in build.gradle
  2. ... AND FINALLY @RunWith(AndroidJUnit4::class) @Category(DoNotRunOnJvm::class) class MainActivityTest { @Test fun

    simple_test() { ActivityScenario.launch(MainActivity::class.java) onView(withId(R.id.fab)).check(matches(isDisplayed())) } }
  3. ... AND FINALLY @RunWith(AndroidJUnit4::class) @Category(DoNotRunOnJvm::class) class MainActivityTest { @Test fun

    simple_test() { ActivityScenario.launch(MainActivity::class.java) onView(withId(R.id.fab)).check(matches(isDisplayed())) } }