Skip to content

Commit

Permalink
Android: force matchers to ignore layouts with GONE visibility, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
rotemmiz committed Jun 6, 2018
1 parent 3fe8353 commit a4b7e76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion detox/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"extends": ["plugin:node/recommended"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
"no-mixed-spaces-and-tabs": "error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ private DetoxMatcher() {

public static Matcher<View> matcherForText(String text) {
// return anyOf(withText(text), withContentDescription(text));
return withText(text);
return allOf(withText(text), isDisplayed());
}

public static Matcher<View> matcherForContentDescription(String contentDescription) {
return withContentDescription(contentDescription);
return allOf(withContentDescription(contentDescription), isDisplayed());
}

public static Matcher<View> matcherForTestId(String testId) {
return withTagValue(is((Object) testId));
return allOf(withTagValue(is((Object) testId)), isDisplayed());
}

public static Matcher<View> matcherForAnd(Matcher<View> m1, Matcher<View> m2) {
Expand All @@ -67,7 +67,7 @@ public static Matcher<View> matcherWithDescendant(Matcher<View> m, Matcher<View>
public static Matcher<View> matcherForClass(final String className) {
try {
Class cls = Class.forName(className);
return isAssignableFrom(cls);
return allOf(isAssignableFrom(cls), isDisplayed());
} catch (ClassNotFoundException e) {
// empty
}
Expand Down

0 comments on commit a4b7e76

Please sign in to comment.