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

Commit 39f631c3 authored by Ioana Moraru's avatar Ioana Moraru
Browse files

Enable FASS assertions for app close

Add a new test rule to CloseAppTransition for comparing the new FASS
assertions with the old flicker testing. If the flicker tests from one category
(presubmit/postsumbit/flaky) are passing or failing, the corresponding
FASS test should have the same behaviour.

Bug: 201523242
Test: see the results in the dashboard go/wm-tests-flicker
Change-Id: Ibb58baefa4aab86a30b3c3f809c411e59383d10b
parent 9baea5ec
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -17,7 +17,9 @@
package com.android.server.wm.flicker.close

import android.app.Instrumentation
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.FlickerBuilderProvider
import com.android.server.wm.flicker.FlickerTestParameter
@@ -35,6 +37,8 @@ import com.android.server.wm.flicker.statusBarLayerIsVisible
import com.android.server.wm.flicker.statusBarLayerRotatesScales
import com.android.server.wm.flicker.statusBarWindowIsVisible
import com.android.server.wm.flicker.replacesLayer
import com.android.server.wm.flicker.rules.WMFlickerServiceRuleForTestSpec
import org.junit.Rule
import org.junit.Test

/**
@@ -44,6 +48,9 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
    protected val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    protected open val testApp: StandardAppHelper = SimpleAppHelper(instrumentation)

    @get:Rule
    val flickerRule = WMFlickerServiceRuleForTestSpec(testSpec)

    /**
     * Specification of the test transition to execute
     */
@@ -189,4 +196,22 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
    open fun launcherLayerReplacesApp() {
        testSpec.replacesLayer(testApp.component, LAUNCHER_COMPONENT)
    }

    @Postsubmit
    @Test
    fun runPresubmitAssertion() {
        flickerRule.checkPresubmitAssertions()
    }

    @Postsubmit
    @Test
    fun runPostsubmitAssertion() {
        flickerRule.checkPostsubmitAssertions()
    }

    @FlakyTest
    @Test
    fun runFlakyAssertion() {
        flickerRule.checkFlakyAssertions()
    }
}
 No newline at end of file