This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(AndroidJUnit4::class) | |
class BaseMainActivityTest { | |
@get:Rule | |
var activityRule = ActivityTestRule(MainActivity::class.java) | |
// the context is often needed in more complex Espresso tests | |
protected val context: Context by lazy { activityRule.activity } | |
@Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(AndroidJUnit4::class) | |
class BaseMainActivityTest { | |
@get:Rule | |
var activityRule = ActivityTestRule(MainActivity::class.java) | |
@Test | |
fun acitivityIsRunning() { | |
if (true) while(true) Thread.sleep(100); /*DEBUG*/ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(AndroidJUnit4::class) | |
class BaseMainActivityTest { | |
@get:Rule | |
var activityRule = ActivityTestRule(MainActivity::class.java) | |
protected val context: Context by lazy { activityRule.activity } | |
// test goes here just like this example from Espresso documentation | |
} |
NewerOlder