File tree 1 file changed +26
-0
lines changed
test/functional/android/android
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,34 @@ def test_viewmatcher
63
63
class : 'androidx.test.espresso.matcher.ViewMatchers'
64
64
} . to_json
65
65
e . click
66
+
66
67
@driver . find_element :accessibility_id , 'Custom View'
67
68
@driver . back
69
+
70
+ # Multiple matchers with 'org.hamcrest.Matchers.allOf'
71
+ # https://developer.android.com/training/testing/espresso/recipes
72
+ # https://developer.android.com/reference/androidx/test/espresso/matcher/ViewMatchers#withsubstring
73
+ e = @driver . find_element :view_matcher , {
74
+ name : 'allOf' ,
75
+ args : [
76
+ {
77
+ name : 'withSubstring' ,
78
+ args : 'Acc' ,
79
+ class : 'androidx.test.espresso.matcher.ViewMatchers'
80
+ } ,
81
+ {
82
+ name : 'isDisplayed' ,
83
+ class : 'androidx.test.espresso.matcher.ViewMatchers'
84
+ } ,
85
+ {
86
+ name : 'withSubstring' ,
87
+ args : "'" ,
88
+ class : 'androidx.test.espresso.matcher.ViewMatchers'
89
+ }
90
+ ] ,
91
+ class : 'org.hamcrest.Matchers'
92
+ } . to_json
93
+ assert_equal "Access'ibility" , e . text
68
94
end
69
95
end
70
96
end
You can’t perform that action at this time.
0 commit comments