Merge pull request #47 from fknives/issue#39-workaround-for-slow-splash-test
Issue#39 Added workaround for slow SplashActivity tests.
This commit is contained in:
commit
65f42bcbff
1 changed files with 17 additions and 0 deletions
|
|
@ -67,6 +67,8 @@ class SplashActivityTest : KoinTest {
|
||||||
|
|
||||||
splashRobot.assertHomeIsStarted()
|
splashRobot.assertHomeIsStarted()
|
||||||
.assertAuthIsNotStarted()
|
.assertAuthIsNotStarted()
|
||||||
|
|
||||||
|
workaroundForActivityScenarioCLoseLockingUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** GIVEN loggedOffState WHEN opened after some time THEN AuthActivity is started */
|
/** GIVEN loggedOffState WHEN opened after some time THEN AuthActivity is started */
|
||||||
|
|
@ -80,6 +82,8 @@ class SplashActivityTest : KoinTest {
|
||||||
|
|
||||||
splashRobot.assertAuthIsStarted()
|
splashRobot.assertAuthIsStarted()
|
||||||
.assertHomeIsNotStarted()
|
.assertHomeIsNotStarted()
|
||||||
|
|
||||||
|
workaroundForActivityScenarioCLoseLockingUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** GIVEN loggedOffState and not enough time WHEN opened THEN no activity is started */
|
/** GIVEN loggedOffState and not enough time WHEN opened THEN no activity is started */
|
||||||
|
|
@ -108,4 +112,17 @@ class SplashActivityTest : KoinTest {
|
||||||
splashRobot.assertHomeIsNotStarted()
|
splashRobot.assertHomeIsNotStarted()
|
||||||
.assertAuthIsNotStarted()
|
.assertAuthIsNotStarted()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This should not be needed, we shouldn't use sleep ever.
|
||||||
|
* However, it seems to be and issue described here: https://github.com/android/android-test/issues/676
|
||||||
|
*
|
||||||
|
* If an activity is finished in code, the ActivityScenario.close() can hang 30 to 45 seconds.
|
||||||
|
* This sleeps let's the Activity finish it state change and unlocks the ActivityScenario.
|
||||||
|
*
|
||||||
|
* As soon as that issue is closed, this should be removed as well.
|
||||||
|
*/
|
||||||
|
private fun workaroundForActivityScenarioCLoseLockingUp() {
|
||||||
|
Thread.sleep(1000L)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue