wda_lib 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wda_lib/find_element.rb +37 -23
- data/lib/wda_lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95ca5c7a24cbfa4cacb1195868207f2d02f78b14
|
4
|
+
data.tar.gz: e9ba4b825df9031188b80141d8c17cb9df597886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f3d79ba4de77d34bf9b2ece6ae678652bf8c29805266e4a508f09c25305da2770dfd61314f372817b509d8a50337def5c3f94bafa293f0d5238252d3655e2a6
|
7
|
+
data.tar.gz: 8316d75df26d475f5952d1c7a3f4b120bf48829fe801a80a6e37ddbea11d3329f3575acfb226332f64ba4721fe707c1a220937d3d16b8a3f631b9f0ea656346d
|
data/lib/wda_lib/find_element.rb
CHANGED
@@ -135,7 +135,7 @@ class WDA
|
|
135
135
|
# xpath('Button', 'name', 'Share') for "//XCUIElementTypeButton[@name='Share']"
|
136
136
|
# @return [Array] contains all elements which match given variables
|
137
137
|
def xpath_search(type, attribute, value)
|
138
|
-
finds :xpath, "//#{match(type)}[@#{attribute}
|
138
|
+
finds :xpath, "//#{match(type)}[@#{attribute}=\"#{value}\"]"
|
139
139
|
end
|
140
140
|
|
141
141
|
# Search predicate string, return first found element
|
@@ -168,20 +168,20 @@ class WDA
|
|
168
168
|
if value.is_a? Numeric
|
169
169
|
finds(:xpath, "//XCUIElementTypeButton")[value]
|
170
170
|
else
|
171
|
-
find(:xpath, "//XCUIElementTypeButton[@name
|
171
|
+
find(:xpath, "//XCUIElementTypeButton[@name=\"#{value}\"]")
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
175
175
|
# Find buttons by given index or value
|
176
176
|
# @param value [String, Integer]
|
177
|
-
# If value is integer then return the
|
178
|
-
# If value is string then return the all
|
177
|
+
# If value is integer then return the all buttons
|
178
|
+
# If value is string then return the all buttons which contain given value
|
179
179
|
# @return [Array] All found buttons
|
180
180
|
def buttons(value = nil)
|
181
181
|
if value.nil?
|
182
182
|
finds(:xpath, "//XCUIElementTypeButton")
|
183
183
|
else
|
184
|
-
finds(:xpath, "//XCUIElementTypeButton[@name
|
184
|
+
finds(:xpath, "//XCUIElementTypeButton[@name=\"#{value}\"]")
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
@@ -206,14 +206,21 @@ class WDA
|
|
206
206
|
if value.is_a? Numeric
|
207
207
|
finds(:xpath, "//XCUIElementTypeTextField")[value]
|
208
208
|
else
|
209
|
-
find
|
209
|
+
find(:xpath, "//XCUIElementTypeTextField[@value=\"#{value}\"]")
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
213
|
# Find the all TextField.
|
214
|
+
# @param value [String]
|
215
|
+
# If value is integer then return all textFields
|
216
|
+
# If value is string then return all textFields which contain given value
|
214
217
|
# @return [Array]
|
215
|
-
def textfields
|
216
|
-
|
218
|
+
def textfields(value = nil)
|
219
|
+
if value.nil?
|
220
|
+
finds(:xpath, "//XCUIElementTypeTextField")
|
221
|
+
else
|
222
|
+
finds(:xpath, "//XCUIElementTypeTextField[@value=\"#{value}\"]")
|
223
|
+
end
|
217
224
|
end
|
218
225
|
|
219
226
|
# Find the first TextField.
|
@@ -224,7 +231,7 @@ class WDA
|
|
224
231
|
|
225
232
|
# Find the last TextField.
|
226
233
|
# @return [TextField]
|
227
|
-
def
|
234
|
+
def last_textfield
|
228
235
|
finds(:xpath, "//XCUIElementTypeTextField").last
|
229
236
|
end
|
230
237
|
|
@@ -237,13 +244,13 @@ class WDA
|
|
237
244
|
if value.is_a? Numeric
|
238
245
|
finds(:xpath, "//XCUIElementTypeSecureTextField")[value]
|
239
246
|
else
|
240
|
-
find
|
247
|
+
find(:xpath, "//XCUIElementTypeSecureTextField[@value=\"#{value}\"]")
|
241
248
|
end
|
242
249
|
end
|
243
250
|
|
244
251
|
# Find the all SecureTextField.
|
245
252
|
# @return [Array]
|
246
|
-
def secure_textfields
|
253
|
+
def secure_textfields
|
247
254
|
finds(:xpath, "//XCUIElementTypeSecureTextField")
|
248
255
|
end
|
249
256
|
|
@@ -256,14 +263,21 @@ class WDA
|
|
256
263
|
if value.is_a? Numeric
|
257
264
|
finds(:xpath, "//XCUIElementTypeStaticText")[value]
|
258
265
|
else
|
259
|
-
find
|
266
|
+
find(:xpath, "//XCUIElementTypeStaticText[@value=\"#{value}\"]")
|
260
267
|
end
|
261
268
|
end
|
262
269
|
|
263
270
|
# Find the all StaticText.
|
271
|
+
# @param value [String]
|
272
|
+
# If value is integer then return all StaticTexts
|
273
|
+
# If value is string then return the all StaticTexts which contain given value
|
264
274
|
# @return [Array]
|
265
|
-
def statictexts
|
266
|
-
|
275
|
+
def statictexts(value = nil)
|
276
|
+
if value.nil?
|
277
|
+
finds(:xpath, "//XCUIElementTypeStaticText")
|
278
|
+
else
|
279
|
+
finds(:xpath, "//XCUIElementTypeStaticText[@value=\"#{value}\"]")
|
280
|
+
end
|
267
281
|
end
|
268
282
|
|
269
283
|
# Find icon by given index or value
|
@@ -275,20 +289,20 @@ class WDA
|
|
275
289
|
if value.is_a? Numeric
|
276
290
|
finds(:xpath, "//XCUIElementTypeIcon")[value]
|
277
291
|
else
|
278
|
-
find
|
292
|
+
find(:xpath, "//XCUIElementTypeIcon[@name=\"#{value}\"]")
|
279
293
|
end
|
280
294
|
end
|
281
295
|
|
282
296
|
# Find icons by given index or value
|
283
|
-
# @param value [String
|
284
|
-
# If value is integer then return
|
285
|
-
# If value is string then return the all icons which
|
297
|
+
# @param value [String]
|
298
|
+
# If value is integer then return all icons
|
299
|
+
# If value is string then return the all icons which contain given value
|
286
300
|
# @return [Array] All found icons
|
287
301
|
def icons(value = nil)
|
288
302
|
if value.nil?
|
289
303
|
finds(:xpath, "//XCUIElementTypeIcon")
|
290
304
|
else
|
291
|
-
finds
|
305
|
+
finds(:xpath, "//XCUIElementTypeIcon[@name=\"#{value}\"]")
|
292
306
|
end
|
293
307
|
end
|
294
308
|
|
@@ -301,20 +315,20 @@ class WDA
|
|
301
315
|
if value.is_a? Numeric
|
302
316
|
finds(:xpath, "//XCUIElementTypeSearchField")[value]
|
303
317
|
else
|
304
|
-
find
|
318
|
+
find(:xpath, "//XCUIElementTypeSearchField[@name=\"#{value}\"]")
|
305
319
|
end
|
306
320
|
end
|
307
321
|
|
308
322
|
# Find icons by given index or value
|
309
|
-
# @param value [String
|
310
|
-
# If value is integer then return
|
323
|
+
# @param value [String]
|
324
|
+
# If value is integer then return all SearchFields
|
311
325
|
# If value is string then return the all SearchFields which have given value as name
|
312
326
|
# @return [Array] All found SearchFields
|
313
327
|
def searchfields(value = nil)
|
314
328
|
if value.nil?
|
315
329
|
finds(:xpath, "//XCUIElementTypeSearchField")
|
316
330
|
else
|
317
|
-
finds
|
331
|
+
finds(:xpath, "//XCUIElementTypeSearchField[@name=\"#{value}\"]")
|
318
332
|
end
|
319
333
|
end
|
320
334
|
|
data/lib/wda_lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wda_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MIN Yi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|