appium_lib 9.2.0 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -165,7 +165,7 @@ module Appium
165
165
  end
166
166
 
167
167
  # Gets the JSON source of window number
168
- # @param window_number [Integer] the int index of the target window
168
+ # @param [Integer] _window_number The int index of the target window
169
169
  # @return [JSON]
170
170
  def source_window(_window_number = 0)
171
171
  # TODO: update comments
@@ -229,17 +229,18 @@ module Appium
229
229
  def string_attr_exact(class_name, attr, value)
230
230
  if automation_name_is_xcuitest?
231
231
  if attr == '*'
232
- %((//#{class_name})[@*[.='#{value}']])
232
+ %((//#{class_name})[@*[.="#{value}"]])
233
233
  else
234
- %((//#{class_name})[@#{attr}='#{value}'])
234
+ %((//#{class_name})[@#{attr}="#{value}"])
235
235
  end
236
236
  else
237
- %(//#{class_name}[@visible="true" and @#{attr}='#{value}'])
237
+ %(//#{class_name}[@visible="true" and @#{attr}="#{value}"])
238
238
  end
239
239
  end
240
240
 
241
241
  # Find the first element exactly matching class and attribute value.
242
242
  # Note: Uses XPath
243
+ # Note: For XCUITest, this method return ALL elements include displayed or not displayed elements.
243
244
  # @param class_name [String] the class name to search for
244
245
  # @param attr [String] the attribute to inspect
245
246
  # @param value [String] the expected value of the attribute
@@ -250,6 +251,7 @@ module Appium
250
251
 
251
252
  # Find all elements exactly matching class and attribute value.
252
253
  # Note: Uses XPath
254
+ # Note: For XCUITest, this method return ALL elements include displayed or not displayed elements.
253
255
  # @param class_name [String] the class name to match
254
256
  # @param attr [String] the attribute to compare
255
257
  # @param value [String] the value of the attribute that the element must have
@@ -262,12 +264,12 @@ module Appium
262
264
  def string_attr_include(class_name, attr, value)
263
265
  if automation_name_is_xcuitest?
264
266
  if attr == '*'
265
- %((//#{class_name})[@*[contains(translate(., '#{value.upcase}', '#{value}'), '#{value}')]])
267
+ %((//#{class_name})[@*[contains(translate(., "#{value.upcase}", "#{value}"), "#{value}")]])
266
268
  else
267
- %((//#{class_name})[contains(translate(@#{attr}, '#{value.upcase}', '#{value}'), '#{value}')])
269
+ %((//#{class_name})[contains(translate(@#{attr}, "#{value.upcase}", "#{value}"), "#{value}")])
268
270
  end
269
271
  else
270
- %(//#{class_name}[@visible="true" and contains(translate(@#{attr},'#{value.upcase}', '#{value}'), '#{value}')])
272
+ %(//#{class_name}[@visible="true" and contains(translate(@#{attr},"#{value.upcase}", "#{value}"), "#{value}")])
271
273
  end
272
274
  end
273
275
 
@@ -295,11 +297,7 @@ module Appium
295
297
  # @param class_name [String] the tag to match
296
298
  # @return [Element]
297
299
  def first_ele(class_name)
298
- if automation_name_is_xcuitest?
299
- @driver.find_element :class, class_name
300
- else
301
- ele_index class_name, 1
302
- end
300
+ ele_index class_name, 1
303
301
  end
304
302
 
305
303
  # Get the last tag that matches class_name
@@ -307,21 +305,21 @@ module Appium
307
305
  # @return [Element]
308
306
  def last_ele(class_name)
309
307
  if automation_name_is_xcuitest?
310
- result = @driver.find_elements :xpath, "(//#{class_name})"
311
- raise _no_such_element if result.empty?
312
- result.last
308
+ visible_elements = tags class_name
309
+ raise _no_such_element if visible_elements.empty?
310
+ visible_elements.last
313
311
  else
314
312
  ele_index class_name, 'last()'
315
313
  end
316
314
  end
317
315
 
318
- # Returns the first visible element matching class_name
316
+ # Returns the first **visible** element matching class_name
319
317
  #
320
318
  # @param class_name [String] the class_name to search for
321
319
  # @return [Element]
322
320
  def tag(class_name)
323
321
  if automation_name_is_xcuitest?
324
- first_ele(class_name)
322
+ raise_error_if_no_element tags(class_name).first
325
323
  else
326
324
  ele_by_json(typeArray: [class_name], onlyVisible: true)
327
325
  end
@@ -333,7 +331,8 @@ module Appium
333
331
  # @return [Element]
334
332
  def tags(class_name)
335
333
  if automation_name_is_xcuitest?
336
- @driver.find_elements :class, class_name
334
+ elements = @driver.find_elements :class, class_name
335
+ select_visible_elements elements
337
336
  else
338
337
  eles_by_json(typeArray: [class_name], onlyVisible: true)
339
338
  end
data/release_notes.md CHANGED
@@ -1,3 +1,18 @@
1
+ #### v9.2.0 2017-01-09
2
+
3
+ - [958ae3e](https://github.com/appium/ruby_lib/commit/958ae3e2fc84b78191baf22e967c8a2fb7eded22) Release 9 2 0 (#460)
4
+ - [292acdf](https://github.com/appium/ruby_lib/commit/292acdf323e7725ef6cc09f2c56d94a8f54ec801) update changelog for 9.2.0 (#458)
5
+ - [1457728](https://github.com/appium/ruby_lib/commit/1457728872214746d9792d916a262a5f996e78ef) Remove last waits (#456)
6
+ - [b10cf83](https://github.com/appium/ruby_lib/commit/b10cf837edafea96e2b2d13e7adf6a87dd448723) add examples for predicate (#455)
7
+ - [d050100](https://github.com/appium/ruby_lib/commit/d050100c0f461c639c417f64ec12d569c412bfb6) Add some documents (#454)
8
+ - [6ee434f](https://github.com/appium/ruby_lib/commit/6ee434f9dbabb7bdb775692382972731c39a71c9) set auomation name from server if client side is nil (#451)
9
+ - [6abb146](https://github.com/appium/ruby_lib/commit/6abb14627fc454684ad4766d9dd95dfd4b52d564) add link to locatorStrategies (#449)
10
+ - [74dc747](https://github.com/appium/ruby_lib/commit/74dc747f56fe78f2bd883c1070d2ea25af0fa382) add changelog (#448)
11
+ - [4e8a449](https://github.com/appium/ruby_lib/commit/4e8a449bf2ff5a3e6f778389b336ecd1a712c25f) arrange a bit (#446)
12
+ - [4efeefa](https://github.com/appium/ruby_lib/commit/4efeefa7e3cb751dcc11280e26169e4ba57b3065) Release 9 1 3 (#445)
13
+ - [ba2fbdc](https://github.com/appium/ruby_lib/commit/ba2fbdcb206609259134fc09eac7940c21cc2c13) Release 9.1.3
14
+
15
+
1
16
  #### v9.1.3 2017-01-04
2
17
 
3
18
  - [ba2fbdc](https://github.com/appium/ruby_lib/commit/ba2fbdcb206609259134fc09eac7940c21cc2c13) Release 9.1.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.2.0
4
+ version: 9.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-09 00:00:00.000000000 Z
11
+ date: 2017-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -196,6 +196,26 @@ dependencies:
196
196
  - - "~>"
197
197
  - !ruby/object:Gem::Version
198
198
  version: 0.46.0
199
+ - !ruby/object:Gem::Dependency
200
+ name: rainbow
201
+ requirement: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ version: 2.1.0
206
+ - - "<"
207
+ - !ruby/object:Gem::Version
208
+ version: 2.2.0
209
+ type: :development
210
+ prerelease: false
211
+ version_requirements: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: 2.1.0
216
+ - - "<"
217
+ - !ruby/object:Gem::Version
218
+ version: 2.2.0
199
219
  description: Ruby library for Appium.
200
220
  email:
201
221
  - code@bootstraponline.com