Issue#104 Create Test verifying screenshot pulling works
This commit is contained in:
parent
69f5f15c3a
commit
bae8c0fc96
8 changed files with 212 additions and 80 deletions
|
|
@ -0,0 +1,36 @@
|
|||
package org.fnives.test.showcase.rule
|
||||
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import org.fnives.test.showcase.android.testutil.activity.SafeCloseActivityRule
|
||||
import org.fnives.test.showcase.android.testutil.screenshot.ScreenshotRule
|
||||
import org.fnives.test.showcase.android.testutil.synchronization.MainDispatcherTestRule
|
||||
import org.fnives.test.showcase.ui.splash.SplashActivity
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.RuleChain
|
||||
import org.junit.runner.RunWith
|
||||
import org.koin.test.KoinTest
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ScreenshotTest : KoinTest {
|
||||
|
||||
private lateinit var activityScenario: ActivityScenario<SplashActivity>
|
||||
|
||||
private val mainDispatcherTestRule = MainDispatcherTestRule()
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
val ruleOrder: RuleChain = RuleChain.outerRule(mainDispatcherTestRule)
|
||||
.around(SafeCloseActivityRule { activityScenario })
|
||||
.around(ScreenshotRule(prefix = "screenshot-rule", takeOnSuccess = true))
|
||||
|
||||
/** GIVEN loggedInState WHEN opened after some time THEN MainActivity is started */
|
||||
@Test
|
||||
fun screenshot() {
|
||||
activityScenario = ActivityScenario.launch(SplashActivity::class.java)
|
||||
activityScenario.moveToState(Lifecycle.State.RESUMED)
|
||||
}
|
||||
}
|
||||
13
app/verifyfiles.sh
Executable file
13
app/verifyfiles.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# if given folder is empty throws error
|
||||
if [ -d "$1" ]; then
|
||||
if [ $(ls -A $1 | wc -l) ];
|
||||
then
|
||||
echo ""
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue