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

Commit be46afa3 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Refactoring transition location on flicker tests

Currently, each test has its own "@Before" method which executed a transition.

Instead, each method now returns its transition and the base test class handles the execution.

Test: atest FlickerTests
Change-Id: I96a0be436ed28ed1d8ffe258ab2a002cca57dd9e
parent 7bd710c0
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import androidx.test.InstrumentationRegistry;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;

import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Ignore;
import org.junit.Test;
@@ -79,11 +78,10 @@ public class ChangeAppRotationTest extends FlickerTestBase {
        return params;
    }

    @Before
    public void runTransition() {
        super.runTransition(
                changeAppRotation(mTestApp, mUiDevice, mBeginRotation, mEndRotation)
                        .includeJankyRuns().build());
    @Override
    TransitionRunner getTransitionToRun() {
        return changeAppRotation(mTestApp, mUiDevice, mBeginRotation, mEndRotation)
                .includeJankyRuns().build();
    }

    @FlakyTest(bugId = 140855415)
+4 −5
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import androidx.test.filters.LargeTest;

import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper;

import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Ignore;
import org.junit.Test;
@@ -47,10 +46,10 @@ public class CloseImeAutoOpenWindowToAppTest extends CloseImeWindowToAppTest {
        mTestApp = new ImeAppAutoFocusHelper(InstrumentationRegistry.getInstrumentation());
    }

    @Before
    public void runTransition() {
        run(editTextLoseFocusToApp((ImeAppAutoFocusHelper) mTestApp, mUiDevice, mBeginRotation)
                .includeJankyRuns().build());
    @Override
    TransitionRunner getTransitionToRun() {
        return editTextLoseFocusToApp((ImeAppAutoFocusHelper) mTestApp, mUiDevice, mBeginRotation)
                .includeJankyRuns().build();
    }

    @FlakyTest(bugId = 141458352)
+4 −5
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import androidx.test.filters.LargeTest;

import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper;

import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Ignore;
import org.junit.Test;
@@ -47,10 +46,10 @@ public class CloseImeAutoOpenWindowToHomeTest extends CloseImeWindowToHomeTest {
        mTestApp = new ImeAppAutoFocusHelper(InstrumentationRegistry.getInstrumentation());
    }

    @Before
    public void runTransition() {
        run(editTextLoseFocusToHome((ImeAppAutoFocusHelper) mTestApp, mUiDevice, mBeginRotation)
                .includeJankyRuns().build());
    @Override
    TransitionRunner getTransitionToRun() {
        return editTextLoseFocusToHome((ImeAppAutoFocusHelper) mTestApp, mUiDevice, mBeginRotation)
                .includeJankyRuns().build();
    }

    @FlakyTest(bugId = 141458352)
+4 −5
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import androidx.test.filters.LargeTest;

import com.android.server.wm.flicker.helpers.ImeAppHelper;

import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -47,10 +46,10 @@ public class CloseImeWindowToAppTest extends NonRotationTestBase {
        mTestApp = new ImeAppHelper(InstrumentationRegistry.getInstrumentation());
    }

    @Before
    public void runTransition() {
        run(editTextLoseFocusToApp((ImeAppHelper) mTestApp, mUiDevice, mBeginRotation)
                .includeJankyRuns().build());
    @Override
    TransitionRunner getTransitionToRun() {
        return editTextLoseFocusToApp((ImeAppHelper) mTestApp, mUiDevice, mBeginRotation)
                .includeJankyRuns().build();
    }

    @Test
+4 −5
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import androidx.test.filters.LargeTest;

import com.android.server.wm.flicker.helpers.ImeAppHelper;

import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Ignore;
import org.junit.Test;
@@ -48,10 +47,10 @@ public class CloseImeWindowToHomeTest extends NonRotationTestBase {
        mTestApp = new ImeAppHelper(InstrumentationRegistry.getInstrumentation());
    }

    @Before
    public void runTransition() {
        run(editTextLoseFocusToHome((ImeAppHelper) mTestApp, mUiDevice, mBeginRotation)
                .includeJankyRuns().build());
    @Override
    TransitionRunner getTransitionToRun() {
        return editTextLoseFocusToHome((ImeAppHelper) mTestApp, mUiDevice, mBeginRotation)
                .includeJankyRuns().build();
    }

    @Test
Loading