-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGREYMatchers+Detox.js
174 lines (149 loc) · 6.26 KB
/
GREYMatchers+Detox.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/**
This code is generated.
For more information see generation/README.md.
*/
class GREYMatchers {
static detoxMatcherForText(text) {
if (typeof text !== "string") throw new Error("text should be a string, but got " + (text + (" (" + (typeof text + ")"))));
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherForText:",
args: [{
type: "NSString",
value: text
}]
};
}
static detox_matcherForAccessibilityLabel(label) {
if (typeof label !== "string") throw new Error("label should be a string, but got " + (label + (" (" + (typeof label + ")"))));
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detox_matcherForAccessibilityLabel:",
args: [{
type: "NSString",
value: label
}]
};
}
static detoxMatcherForScrollChildOfMatcher(matcher) {
if (typeof matcher !== "object" || matcher.type !== "Invocation" || typeof matcher.value !== "object" || typeof matcher.value.target !== "object" || matcher.value.target.value !== "GREYMatchers") {
throw new Error('matcher should be a GREYMatcher, but got ' + JSON.stringify(matcher));
}
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherForScrollChildOfMatcher:",
args: [matcher]
};
}
static detoxMatcherAvoidingProblematicReactNativeElements(matcher) {
if (typeof matcher !== "object" || matcher.type !== "Invocation" || typeof matcher.value !== "object" || typeof matcher.value.target !== "object" || matcher.value.target.value !== "GREYMatchers") {
throw new Error('matcher should be a GREYMatcher, but got ' + JSON.stringify(matcher));
}
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherAvoidingProblematicReactNativeElements:",
args: [matcher]
};
}
static detoxMatcherForBothAnd(firstMatcher, secondMatcher) {
if (typeof firstMatcher !== "object" || firstMatcher.type !== "Invocation" || typeof firstMatcher.value !== "object" || typeof firstMatcher.value.target !== "object" || firstMatcher.value.target.value !== "GREYMatchers") {
throw new Error('firstMatcher should be a GREYMatcher, but got ' + JSON.stringify(firstMatcher));
}
if (typeof secondMatcher !== "object" || secondMatcher.type !== "Invocation" || typeof secondMatcher.value !== "object" || typeof secondMatcher.value.target !== "object" || secondMatcher.value.target.value !== "GREYMatchers") {
throw new Error('secondMatcher should be a GREYMatcher, but got ' + JSON.stringify(secondMatcher));
}
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherForBoth:and:",
args: [firstMatcher, secondMatcher]
};
}
static detoxMatcherForBothAndAncestorMatcher(firstMatcher, ancestorMatcher) {
if (typeof firstMatcher !== "object" || firstMatcher.type !== "Invocation" || typeof firstMatcher.value !== "object" || typeof firstMatcher.value.target !== "object" || firstMatcher.value.target.value !== "GREYMatchers") {
throw new Error('firstMatcher should be a GREYMatcher, but got ' + JSON.stringify(firstMatcher));
}
if (typeof ancestorMatcher !== "object" || ancestorMatcher.type !== "Invocation" || typeof ancestorMatcher.value !== "object" || typeof ancestorMatcher.value.target !== "object" || ancestorMatcher.value.target.value !== "GREYMatchers") {
throw new Error('ancestorMatcher should be a GREYMatcher, but got ' + JSON.stringify(ancestorMatcher));
}
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherForBoth:andAncestorMatcher:",
args: [firstMatcher, ancestorMatcher]
};
}
static detoxMatcherForBothAndDescendantMatcher(firstMatcher, descendantMatcher) {
if (typeof firstMatcher !== "object" || firstMatcher.type !== "Invocation" || typeof firstMatcher.value !== "object" || typeof firstMatcher.value.target !== "object" || firstMatcher.value.target.value !== "GREYMatchers") {
throw new Error('firstMatcher should be a GREYMatcher, but got ' + JSON.stringify(firstMatcher));
}
if (typeof descendantMatcher !== "object" || descendantMatcher.type !== "Invocation" || typeof descendantMatcher.value !== "object" || typeof descendantMatcher.value.target !== "object" || descendantMatcher.value.target.value !== "GREYMatchers") {
throw new Error('descendantMatcher should be a GREYMatcher, but got ' + JSON.stringify(descendantMatcher));
}
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherForBoth:andDescendantMatcher:",
args: [firstMatcher, descendantMatcher]
};
}
static detoxMatcherForNot(matcher) {
if (typeof matcher !== "object" || matcher.type !== "Invocation" || typeof matcher.value !== "object" || typeof matcher.value.target !== "object" || matcher.value.target.value !== "GREYMatchers") {
throw new Error('matcher should be a GREYMatcher, but got ' + JSON.stringify(matcher));
}
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherForNot:",
args: [matcher]
};
}
static detoxMatcherForClass(aClassName) {
if (typeof aClassName !== "string") throw new Error("aClassName should be a string, but got " + (aClassName + (" (" + (typeof aClassName + ")"))));
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherForClass:",
args: [{
type: "NSString",
value: aClassName
}]
};
}
static detoxMatcherForPickerViewChildOfMatcher(matcher) {
if (typeof matcher !== "object" || matcher.type !== "Invocation" || typeof matcher.value !== "object" || typeof matcher.value.target !== "object" || matcher.value.target.value !== "GREYMatchers") {
throw new Error('matcher should be a GREYMatcher, but got ' + JSON.stringify(matcher));
}
return {
target: {
type: "Class",
value: "GREYMatchers"
},
method: "detoxMatcherForPickerViewChildOfMatcher:",
args: [matcher]
};
}
}
module.exports = GREYMatchers;