Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c69df52b authored by Nataniel Borges's avatar Nataniel Borges Committed by Pablo Gamito
Browse files

Create ArtifactSaverRule to be reused in different tests

Bug: 294055054
Test: atest FlickerLibTest WMShellFlickerServiceTests
Change-Id: If059065ebcd058b309c7f164f586afbfa6b979d5
parent e9f30dae
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.platform.test.rule.UnlockScreenRule
import android.tools.common.NavBar
import android.tools.common.Rotation
import android.tools.device.apphelpers.MessagingAppHelper
import android.tools.device.flicker.rules.ArtifactSaverRule
import android.tools.device.flicker.rules.ChangeDisplayOrientationRule
import android.tools.device.flicker.rules.LaunchAppRule
import android.tools.device.flicker.rules.RemoveAllTasksButHomeRule
@@ -33,9 +34,10 @@ object Utils {
    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()

    fun testSetupRule(navigationMode: NavBar, rotation: Rotation): RuleChain {
        return RuleChain.outerRule(UnlockScreenRule())
        return RuleChain.outerRule(ArtifactSaverRule())
            .around(UnlockScreenRule())
            .around(
                NavigationModeRule(navigationMode.value, /* changeNavigationModeAfterTest */ false)
                NavigationModeRule(navigationMode.value, false)
            )
            .around(
                LaunchAppRule(MessagingAppHelper(instrumentation), clearCacheAfterParsing = false)