Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: ios/chrome/test/earl_grey/chrome_matchers.mm

Issue 2952343002: EG Tests for Sad Tab View (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/test/earl_grey/chrome_matchers.mm
diff --git a/ios/chrome/test/earl_grey/chrome_matchers.mm b/ios/chrome/test/earl_grey/chrome_matchers.mm
index c9aa5e426c40446b9905a82ffd69db0894fba2db..3f34db1aaf735aa929d1a746ef054230a999d67c 100644
--- a/ios/chrome/test/earl_grey/chrome_matchers.mm
+++ b/ios/chrome/test/earl_grey/chrome_matchers.mm
@@ -222,4 +222,20 @@ id<GREYMatcher> SettingsMenuBackButton() {
grey_accessibilityTrait(UIAccessibilityTraitButton), nil);
}
+id<GREYMatcher> ContainsText(NSString* text) {
+ MatchesBlock matches = ^BOOL(id element) {
+ return [[element text] containsString:text];
+ };
+ DescribeToBlock describe = ^void(id<GREYDescription> description) {
+ [description appendText:[NSString stringWithFormat:@"hasText('%@')", text]];
+ };
+ id<GREYMatcher> matcher =
+ [[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
+ descriptionBlock:describe];
+ return grey_allOf(grey_anyOf(grey_kindOfClass([UILabel class]),
+ grey_kindOfClass([UITextField class]),
+ grey_kindOfClass([UITextView class]), nil),
+ matcher, nil);
+}
+
} // namespace chrome_test_util
« ios/chrome/test/earl_grey/chrome_matchers.h ('K') | « ios/chrome/test/earl_grey/chrome_matchers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698