Skip to content

Commit

Permalink
Fix crash on /enabled and /selected (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeepv authored and mykola-mokhnach committed Dec 14, 2018
1 parent bb340f5 commit 94bece3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package io.appium.espressoserver.lib.handlers;

import junit.framework.AssertionFailedError;

import androidx.test.espresso.NoMatchingViewException;
import androidx.test.espresso.ViewInteraction;

Expand All @@ -34,7 +36,7 @@ public Boolean handle(AppiumParams params) throws AppiumException {
try {
viewInteraction.check(matches(isEnabled()));
return true;
} catch (NoMatchingViewException e) {
} catch (NoMatchingViewException | AssertionFailedError e) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package io.appium.espressoserver.lib.handlers;

import junit.framework.AssertionFailedError;

import androidx.test.espresso.NoMatchingViewException;
import androidx.test.espresso.ViewInteraction;

Expand All @@ -34,7 +36,7 @@ public Boolean handle(AppiumParams params) throws AppiumException {
try {
viewInteraction.check(matches(isSelected()));
return true;
} catch (NoMatchingViewException e) {
} catch (NoMatchingViewException | AssertionFailedError e) {
return false;
}
}
Expand Down

0 comments on commit 94bece3

Please sign in to comment.