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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4297f9169a3990320cd044cf27ebcc55647fcec9
4
- data.tar.gz: d1a4b4c8972b8c00e547a1d5d63df1e0700402aa
3
+ metadata.gz: 95ca5c7a24cbfa4cacb1195868207f2d02f78b14
4
+ data.tar.gz: e9ba4b825df9031188b80141d8c17cb9df597886
5
5
  SHA512:
6
- metadata.gz: c3c826a5c1fc911c4d0674faf1d3a4eab0740876d44beb9f0a34f8ccb41833045985edd61f0887f7138e2ddf6d46d14ede102aa22ab73bb516834793afe6c394
7
- data.tar.gz: 73954363c11f6f82640939a2348816f0eff7be234d558b095fd722d5779a4209d17d4b389bf02ddd450e76bf273305056db432e6377f55877ceae2cb4745d4cd
6
+ metadata.gz: 9f3d79ba4de77d34bf9b2ece6ae678652bf8c29805266e4a508f09c25305da2770dfd61314f372817b509d8a50337def5c3f94bafa293f0d5238252d3655e2a6
7
+ data.tar.gz: 8316d75df26d475f5952d1c7a3f4b120bf48829fe801a80a6e37ddbea11d3329f3575acfb226332f64ba4721fe707c1a220937d3d16b8a3f631b9f0ea656346d
@@ -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}='#{value}']"
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='#{value}']")
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 button at that index
178
- # If value is string then return the all button which contains given value
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='#{value}']")
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 :xpath, "//XCUIElementTypeTextField[@value='#{value}']"
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
- finds(:xpath, "//XCUIElementTypeTextField")
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 first_textfield
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 :xpath, "//XCUIElementTypeSecureTextField[@value='#{value}']"
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 :xpath, "//XCUIElementTypeStaticText[@value='#{value}']"
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
- finds(:xpath, "//XCUIElementTypeStaticText")
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 :xpath, "//XCUIElementTypeIcon[@name='#{value}']"
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, Integer]
284
- # If value is integer then return the icon at that index
285
- # If value is string then return the all icons which contains given value
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 :xpath, "//XCUIElementTypeIcon[@name='#{value}']"
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 :xpath, "//XCUIElementTypeSearchField[@name='#{value}']"
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, Integer]
310
- # If value is integer then return the SearchField at that index
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 :xpath, "//XCUIElementTypeSearchField[@name='#{value}']"
331
+ finds(:xpath, "//XCUIElementTypeSearchField[@name=\"#{value}\"]")
318
332
  end
319
333
  end
320
334
 
@@ -1,3 +1,3 @@
1
1
  class WDA
2
- VERSION = '0.0.13'
2
+ VERSION = '0.0.14'
3
3
  end
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.13
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-24 00:00:00.000000000 Z
11
+ date: 2016-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake