use of android.support.test.espresso.NoMatchingRootException in project mobile-center-sdk-android by Microsoft.
the class EspressoUtils method waitFor.
public static ViewInteraction waitFor(final ViewInteraction viewInteraction, final long millis) throws InterruptedException {
final long startTime = System.currentTimeMillis();
final long endTime = startTime + millis;
final View[] found = new View[] { null };
while (System.currentTimeMillis() < endTime) {
try {
viewInteraction.check(new ViewAssertion() {
@Override
public void check(View view, NoMatchingViewException noViewFoundException) {
found[0] = view;
}
});
} catch (NoMatchingRootException ignored) {
}
if (found[0] != null)
return viewInteraction;
Thread.sleep(CHECK_DELAY);
}
Assert.fail();
return viewInteraction;
}
use of android.support.test.espresso.NoMatchingRootException in project AppCenter-SDK-Android by Microsoft.
the class EspressoUtils method waitFor.
public static ViewInteraction waitFor(final ViewInteraction viewInteraction, final long millis) throws InterruptedException {
final long startTime = System.currentTimeMillis();
final long endTime = startTime + millis;
final View[] found = new View[] { null };
while (System.currentTimeMillis() < endTime) {
try {
viewInteraction.check(new ViewAssertion() {
@Override
public void check(View view, NoMatchingViewException noViewFoundException) {
found[0] = view;
}
});
} catch (NoMatchingRootException ignored) {
}
if (found[0] != null)
return viewInteraction;
Thread.sleep(CHECK_DELAY);
}
Assert.fail();
return viewInteraction;
}
Aggregations