Last active
December 13, 2017 10:44
-
-
Save EmmanuelGuther/1205a53d11295e149ab61139bedc9873 to your computer and use it in GitHub Desktop.
AndroidTest instrumentation: Check if activity is was launched
This file contains hidden or 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
Instrumentation.ActivityMonitor activityBackMonitor = getInstrumentation().addMonitor(StationsActivity.class.getName(), null, false); | |
//CHECK IF ACTIVITY IS LAUNCHED | |
StationDetailActivity nextActivity = (StationDetailActivity) getInstrumentation().waitForMonitorWithTimeout(activityMonitor, 5000); | |
// next activity is opened and captured. | |
assertNotNull(nextActivity); | |
try { | |
Thread.sleep(2000); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment