Issue#39 Fix most test's running time via using close on ActivityScenario.
This commit is contained in:
parent
e2bf4b3bce
commit
1223bfdc9a
4 changed files with 6 additions and 8 deletions
|
|
@ -29,7 +29,7 @@ object SetupAuthenticationState : KoinTest {
|
||||||
|
|
||||||
mainDispatcherTestRule.advanceUntilIdleOrActivityIsDestroyed()
|
mainDispatcherTestRule.advanceUntilIdleOrActivityIsDestroyed()
|
||||||
|
|
||||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
activityScenario.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setupLogout(
|
fun setupLogout(
|
||||||
|
|
@ -43,6 +43,6 @@ object SetupAuthenticationState : KoinTest {
|
||||||
|
|
||||||
mainDispatcherTestRule.advanceUntilIdleOrActivityIsDestroyed()
|
mainDispatcherTestRule.advanceUntilIdleOrActivityIsDestroyed()
|
||||||
|
|
||||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
activityScenario.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package org.fnives.test.showcase.ui.home
|
package org.fnives.test.showcase.ui.home
|
||||||
|
|
||||||
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
||||||
import androidx.lifecycle.Lifecycle
|
|
||||||
import androidx.test.core.app.ActivityScenario
|
import androidx.test.core.app.ActivityScenario
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import org.fnives.test.showcase.model.content.FavouriteContent
|
import org.fnives.test.showcase.model.content.FavouriteContent
|
||||||
|
|
@ -73,7 +72,7 @@ class MainActivityTest : KoinTest {
|
||||||
|
|
||||||
@After
|
@After
|
||||||
fun tearDown() {
|
fun tearDown() {
|
||||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
activityScenario.close()
|
||||||
disposable.dispose()
|
disposable.dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,7 +129,7 @@ class MainActivityTest : KoinTest {
|
||||||
|
|
||||||
val expectedItem = FavouriteContent(ContentData.contentSuccess.first(), true)
|
val expectedItem = FavouriteContent(ContentData.contentSuccess.first(), true)
|
||||||
|
|
||||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
activityScenario.close()
|
||||||
activityScenario = ActivityScenario.launch(MainActivity::class.java)
|
activityScenario = ActivityScenario.launch(MainActivity::class.java)
|
||||||
mainDispatcherTestRule.advanceUntilIdleWithIdlingResources()
|
mainDispatcherTestRule.advanceUntilIdleWithIdlingResources()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package org.fnives.test.showcase.ui.login
|
package org.fnives.test.showcase.ui.login
|
||||||
|
|
||||||
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
||||||
import androidx.lifecycle.Lifecycle
|
|
||||||
import androidx.test.core.app.ActivityScenario
|
import androidx.test.core.app.ActivityScenario
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import org.fnives.test.showcase.R
|
import org.fnives.test.showcase.R
|
||||||
|
|
@ -63,7 +62,7 @@ class AuthActivityTest : KoinTest {
|
||||||
|
|
||||||
@After
|
@After
|
||||||
fun tearDown() {
|
fun tearDown() {
|
||||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
activityScenario.close()
|
||||||
disposable.dispose()
|
disposable.dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class SplashActivityTest : KoinTest {
|
||||||
|
|
||||||
@After
|
@After
|
||||||
fun tearDown() {
|
fun tearDown() {
|
||||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
activityScenario.close()
|
||||||
disposable.dispose()
|
disposable.dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue