Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: force matchers to ignore layouts with GONE visibility #775

Merged
merged 1 commit into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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