Change view matcher

pull/37/head
Mattia Iavarone 8 years ago
parent 6be119a75b
commit 3b458adfa2
  1. 2
      .travis.yml
  2. 5
      cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java

@ -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

@ -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<T extends GestureLayout> extends BaseTes
}
protected final ViewInteraction onLayout() {
return onView(Matchers.<View>is(layout)).inRoot(any(Root.class));
return onView(Matchers.<View>is(layout))
.inRoot(RootMatchers.withDecorView(
Matchers.is(rule.getActivity().getWindow().getDecorView())));
}
}

Loading…
Cancel
Save