diff --git a/.travis.yml b/.travis.yml index c68cf764..2c1f6c0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ jdk: env: global: # Where to run androidTests - - EMULATOR_API=24 # was 22 + - EMULATOR_API=22 # 24 has some issues - EMULATOR_ABI=armeabi-v7a - EMULATOR_TAG=default - PATH=$ANDROID_HOME:$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$PATH diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java index e6c2a5cf..84820b0f 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java @@ -8,6 +8,7 @@ import android.support.test.espresso.Root; import android.support.test.espresso.ViewAssertion; import android.support.test.espresso.ViewInteraction; import android.support.test.espresso.assertion.ViewAssertions; +import android.support.test.espresso.matcher.RootMatchers; import android.support.test.espresso.matcher.ViewMatchers; import android.support.test.rule.ActivityTestRule; import android.view.MotionEvent; @@ -57,6 +58,8 @@ public abstract class GestureLayoutTest extends BaseTes } protected final ViewInteraction onLayout() { - return onView(Matchers.is(layout)).inRoot(any(Root.class)); + return onView(Matchers.is(layout)) + .inRoot(RootMatchers.withDecorView( + Matchers.is(rule.getActivity().getWindow().getDecorView()))); } }