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

Commit 5e3fb9c3 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Use tapl when possible

Update tests to use tapl for press back, go home and quick switch actions

Bug: 217380695
Test: atest FlickerTests
Change-Id: Icdf45cf42a2206845b84c8b15010b34265c497f0
parent b2f97af5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ abstract class BaseTest @JvmOverloads constructor(
        testSpec.setIsTablet(
            WindowManagerStateHelper(instrumentation).currentState.wmState.isTablet
        )
        tapl.setExpectedRotationCheckEnabled(true)
    }

    /**
+4 −1
Original line number Diff line number Diff line
@@ -49,6 +49,9 @@ class OpenActivityEmbeddingPlaceholderSplit(
    /** {@inheritDoc} */
    override val transition: FlickerBuilder.() -> Unit = {
        setup {
            test {
                tapl.setExpectedRotationCheckEnabled(false)
            }
            eachRun {
                testApp.launchViaIntent(wmHelper)
            }
@@ -58,7 +61,7 @@ class OpenActivityEmbeddingPlaceholderSplit(
        }
        teardown {
            test {
                device.pressHome()
                tapl.goHome()
                testApp.exit(wmHelper)
            }
        }
+6 −1
Original line number Diff line number Diff line
@@ -68,12 +68,17 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
    override val transition: FlickerBuilder.() -> Unit
        get() = {
            super.transition(this)
            setup {
                test {
                    tapl.setExpectedRotationCheckEnabled(false)
                }
            }
            transitions {
                // Can't use TAPL at the moment because of rotation test issues
                // When pressing home, TAPL expects the orientation to remain constant
                // However, when closing a landscape app back to a portrait-only launcher
                // this causes an error in verifyActiveContainer();
                device.pressHome()
                tapl.goHome()
                wmHelper.StateSyncBuilder()
                    .withHomeActivityVisible()
                    .waitForAndVerify()
+4 −1
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ class CloseImeAutoOpenWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTes
    /** {@inheritDoc} */
    override val transition: FlickerBuilder.() -> Unit = {
        setup {
            test {
                tapl.setExpectedRotationCheckEnabled(false)
            }
            eachRun {
                testApp.launchViaIntent(wmHelper)
            }
@@ -67,7 +70,7 @@ class CloseImeAutoOpenWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTes
            }
        }
        transitions {
            device.pressHome()
            tapl.goHome()
            wmHelper.StateSyncBuilder()
                .withHomeActivityVisible()
                .withImeGone()
+4 −1
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
    /** {@inheritDoc} */
    override val transition: FlickerBuilder.() -> Unit = {
        setup {
            test {
                tapl.setExpectedRotationCheckEnabled(false)
            }
            eachRun {
                imeTestApp.launchViaIntent(wmHelper)
                imeTestApp.openIME(wmHelper)
@@ -59,7 +62,7 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
        }
        teardown {
            eachRun {
                device.pressHome()
                tapl.goHome()
                wmHelper.StateSyncBuilder()
                    .withHomeActivityVisible()
                    .waitForAndVerify()
Loading