appium_lib 9.6.0 → 9.6.1

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.
@@ -112,3 +112,7 @@ xpaths("//some xpaths")
112
112
 
113
113
  ## Other actions
114
114
  Basically, other actions such as `type` are compatible with `automationName = Appium`.
115
+
116
+ ## Pasteboard
117
+ - Simulator only
118
+ - https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios-xctest-pasteboard.md
@@ -0,0 +1,10 @@
1
+ require_relative 'uiautomator2/helper'
2
+ require_relative 'uiautomator2/element'
3
+
4
+ module Appium
5
+ module Ios
6
+ module Xcuitest
7
+ # parent
8
+ end # module Xcuitest
9
+ end # module Ios
10
+ end # module Appium
@@ -0,0 +1,10 @@
1
+ require_relative 'element/button'
2
+
3
+ module Appium
4
+ module Android
5
+ module Uiautomator2
6
+ module Element
7
+ end # module Element
8
+ end # module Uiautomator2
9
+ end # module Android
10
+ end # module Appium
@@ -0,0 +1,13 @@
1
+ module Appium
2
+ class Driver
3
+ module Capabilities
4
+ # @param [Hash] opts_caps Capabilities for Appium server. All capability keys are converted to lowerCamelCase when
5
+ # this client sends capabilities to Appium server as JSON format.
6
+ # @return [::Selenium::WebDriver::Remote::W3C::Capabilities] Return instance of Appium::Driver::Capabilities
7
+ # inherited ::Selenium::WebDriver::Remote::W3C::Capabilities
8
+ def self.init_caps_for_appium(opts_caps = {})
9
+ ::Selenium::WebDriver::Remote::W3C::Capabilities.new(opts_caps)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  module Appium
2
2
  # Version and Date are defined on the 'Appium' module, not 'Appium::Common'
3
- VERSION = '9.6.0'.freeze unless defined? ::Appium::VERSION
4
- DATE = '2017-08-19'.freeze unless defined? ::Appium::DATE
3
+ VERSION = '9.6.1'.freeze unless defined? ::Appium::VERSION
4
+ DATE = '2017-08-27'.freeze unless defined? ::Appium::DATE
5
5
  end
@@ -3,6 +3,9 @@ require 'ap'
3
3
  require 'selenium-webdriver'
4
4
  require 'nokogiri'
5
5
 
6
+ # base
7
+ require_relative 'capabilities'
8
+
6
9
  # common
7
10
  require_relative 'common/helper'
8
11
  require_relative 'common/wait'
@@ -25,16 +28,7 @@ require_relative 'ios/element/textfield'
25
28
  require_relative 'ios/element/text'
26
29
  require_relative 'ios/mobile_methods'
27
30
 
28
- # ios - xcuitest
29
- require_relative 'ios/xcuitest/element'
30
- require_relative 'ios/xcuitest/gestures'
31
- require_relative 'ios/xcuitest/mobile_methods'
32
- require_relative 'ios/xcuitest/device'
33
- require_relative 'ios/xcuitest/helper'
34
- require_relative 'ios/xcuitest/element/text'
35
- require_relative 'ios/xcuitest/element/textfield'
36
- require_relative 'ios/xcuitest/element/generic'
37
- require_relative 'ios/xcuitest/element/button'
31
+ require_relative 'ios/xcuitest'
38
32
 
39
33
  # android
40
34
  require_relative 'android/helper'
@@ -50,7 +44,7 @@ require_relative 'android/mobile_methods'
50
44
  require_relative 'android/device'
51
45
 
52
46
  # android - uiautomator2
53
- require_relative 'android/uiautomator2/helper.rb'
47
+ require_relative 'android/uiautomator2'
54
48
 
55
49
  # device methods
56
50
  require_relative 'device/device'
@@ -268,18 +262,6 @@ module Appium
268
262
  Gem.loaded_specs['selenium-webdriver'].version >= Gem::Version.new(version)
269
263
  end
270
264
 
271
- class Driver
272
- module Capabilities
273
- # @param [Hash] opts_caps Capabilities for Appium server. All capability keys are converted to lowerCamelCase when
274
- # this client sends capabilities to Appium server as JSON format.
275
- # @return [::Selenium::WebDriver::Remote::W3C::Capabilities] Return instance of Appium::Driver::Capabilities
276
- # inherited ::Selenium::WebDriver::Remote::W3C::Capabilities
277
- def self.init_caps_for_appium(opts_caps = {})
278
- ::Selenium::WebDriver::Remote::W3C::Capabilities.new(opts_caps)
279
- end
280
- end
281
- end
282
-
283
265
  class Driver
284
266
  # attr readers are promoted to global scope. To avoid clobbering, they're
285
267
  # made available via the driver_attributes method
@@ -387,11 +369,15 @@ module Appium
387
369
  # @param opts [Object] A hash containing various options.
388
370
  # @param global_driver [Bool] A bool require global driver before initialize.
389
371
  # @return [Driver]
390
- def initialize(opts = {}, global_driver = true)
391
- if global_driver
372
+ def initialize(opts = {}, global_driver = nil)
373
+ if global_driver.nil?
392
374
  warn '[DEPRECATION] Appium::Driver.new(opts) will not generate global driver by default.' \
393
375
  'If you would like to generate the global driver dy default, ' \
394
376
  'please initialise driver with Appium::Driver.new(opts, true)'
377
+ global_driver = true # if global_driver is nil, then global_driver must be default value.
378
+ end
379
+
380
+ if global_driver
395
381
  $driver.driver_quit if $driver
396
382
  end
397
383
  raise 'opts must be a hash' unless opts.is_a? Hash
@@ -426,13 +412,16 @@ module Appium
426
412
  extend Appium::Android
427
413
  extend Appium::Android::Device
428
414
  if automation_name_is_uiautomator2?
415
+ extend Appium::Android::Uiautomator2
429
416
  extend Appium::Android::Uiautomator2::Helper
417
+ extend Appium::Android::Uiautomator2::Element
430
418
  end
431
419
  else
432
420
  extend Appium::Ios
433
421
  if automation_name_is_xcuitest?
434
- # Override touch actions and patch_webdriver_element
435
422
  extend Appium::Ios::Xcuitest
423
+ extend Appium::Ios::Xcuitest::SearchContext
424
+ extend Appium::Ios::Xcuitest::Command
436
425
  extend Appium::Ios::Xcuitest::Helper
437
426
  extend Appium::Ios::Xcuitest::Gesture
438
427
  extend Appium::Ios::Xcuitest::Device
@@ -0,0 +1,15 @@
1
+ require_relative 'xcuitest/search_context'
2
+ require_relative 'xcuitest/element'
3
+ require_relative 'xcuitest/gestures'
4
+ require_relative 'xcuitest/command'
5
+ require_relative 'xcuitest/device'
6
+ require_relative 'xcuitest/helper'
7
+ require_relative 'xcuitest/element'
8
+
9
+ module Appium
10
+ module Ios
11
+ module Xcuitest
12
+ # parent
13
+ end # module Xcuitest
14
+ end # module Ios
15
+ end # module Appium
@@ -0,0 +1,8 @@
1
+ require_relative 'command/pasteboard'
2
+
3
+ module Appium
4
+ module Ios
5
+ module Command
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,33 @@
1
+ module Appium
2
+ module Ios
3
+ module Xcuitest
4
+ module Command
5
+ # @param [string] content The content of the pasteboard. The previous content is going to be overridden.
6
+ # The parameter is mandatory
7
+ # @option opts [string] :encoding Encoding of the given content. UTF-8 by default.
8
+ #
9
+ # ```ruby
10
+ # set_pasteboard content: "sample content"
11
+ # ```
12
+ def set_pasteboard(content:, encoding: nil)
13
+ args = { content: content }
14
+ args[:encoding] = encoding if encoding
15
+
16
+ @driver.execute_script 'mobile: setPasteboard', args
17
+ end
18
+
19
+ # @option opts [string] :encoding Encoding of the received pasteboard content. UTF-8 by default.
20
+ #
21
+ # ```ruby
22
+ # get_pasteboard encoding: "shift-jis"
23
+ # ```
24
+ def get_pasteboard(encoding: nil)
25
+ args = {}
26
+ args[:encoding] = encoding if encoding
27
+
28
+ @driver.execute_script 'mobile: getPasteboard', args
29
+ end
30
+ end
31
+ end # module Xcuitest
32
+ end # module Ios
33
+ end # module Appium
@@ -1,24 +1,31 @@
1
+ require_relative 'element/text'
2
+ require_relative 'element/textfield'
3
+ require_relative 'element/generic'
4
+ require_relative 'element/button'
5
+
1
6
  module Appium
2
7
  module Ios
3
8
  module Xcuitest
4
- # @private
5
- # class_eval inside a method because class Selenium::WebDriver::Element
6
- # will trigger as soon as the file is required. in contrast a method
7
- # will trigger only when invoked.
8
- def patch_webdriver_element
9
- Selenium::WebDriver::Element.class_eval do
10
- # Enable access to iOS accessibility label
11
- # accessibility identifier is supported as 'name'
12
- def label
13
- attribute('label')
14
- end
9
+ module Element
10
+ # @private
11
+ # class_eval inside a method because class Selenium::WebDriver::Element
12
+ # will trigger as soon as the file is required. in contrast a method
13
+ # will trigger only when invoked.
14
+ def patch_webdriver_element
15
+ Selenium::WebDriver::Element.class_eval do
16
+ # Enable access to iOS accessibility label
17
+ # accessibility identifier is supported as 'name'
18
+ def label
19
+ attribute('label')
20
+ end
15
21
 
16
- # Cross platform way of entering text into a textfield
17
- def type(text)
18
- send_keys text
19
- end # def type
20
- end # Selenium::WebDriver::Element.class_eval
21
- end # def patch_webdriver_element
22
+ # Cross platform way of entering text into a textfield
23
+ def type(text)
24
+ send_keys text
25
+ end # def type
26
+ end # Selenium::WebDriver::Element.class_eval
27
+ end # def patch_webdriver_element
28
+ end # module Element
22
29
  end # module Xcuitest
23
30
  end # module Ios
24
31
  end # module Appium
@@ -0,0 +1,25 @@
1
+ module Appium
2
+ module Ios
3
+ module Xcuitest
4
+ module SearchContext
5
+ class << self
6
+ # @!method ios_class_chain_find
7
+ # Only for XCUITest(WebDriverAgent)
8
+ # find_element/s can be used with a [class chain]( https://github.com/facebook/WebDriverAgent/wiki/Queries)
9
+ #
10
+ # ```ruby
11
+ # # select the third child button of the first child window element
12
+ # find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]'
13
+ # # select all the children windows
14
+ # find_elements :class_chain, 'XCUIElementTypeWindow'
15
+ # # select the second last child of the second child window
16
+ # find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]'
17
+ # ```
18
+ def extended(_mod)
19
+ ::Appium::Driver::SearchContext::FINDERS[:class_chain] = '-ios class chain'
20
+ end
21
+ end
22
+ end
23
+ end # module Xcuitest
24
+ end # module Ios
25
+ end # module Appium
@@ -1,3 +1,19 @@
1
+ #### v9.6.0 2017-08-20
2
+
3
+ - [e1a2cd4](https://github.com/appium/ruby_lib/commit/e1a2cd493a370655b390a1d3803a85fbdb5f7f9d) [Release 9 6 0 (#643)](https://github.com/appium/ruby_lib/issues/643)
4
+ - [6c6e916](https://github.com/appium/ruby_lib/commit/6c6e9165998a457188b1e53476c9bdbb18fa2ef7) [refactor: separate uiautomator2 (#642)](https://github.com/appium/ruby_lib/issues/642)
5
+ - [2b1a5ee](https://github.com/appium/ruby_lib/commit/2b1a5eef44be48df5e14dc42000b4a776a2bae5b) [Append documentations (#640)](https://github.com/appium/ruby_lib/issues/640)
6
+ - [6ee404d](https://github.com/appium/ruby_lib/commit/6ee404ddbe932b97d50904a2f273b7404485d79e) [refactor: Separate xcuitest more (#639)](https://github.com/appium/ruby_lib/issues/639)
7
+ - [8a7c386](https://github.com/appium/ruby_lib/commit/8a7c386a51e9f83826e1d5d799cc509cd0c7e3ae) [feature: test code for multiple iOS simulators (#637)](https://github.com/appium/ruby_lib/issues/637)
8
+ - [b7daaac](https://github.com/appium/ruby_lib/commit/b7daaac9b2262c80ee679263a809bd98371b312b) [fix: Fix Android scroll_to and scroll_to_exact (#638)](https://github.com/appium/ruby_lib/issues/638)
9
+ - [65b2c7a](https://github.com/appium/ruby_lib/commit/65b2c7a9edb65e50c61c5e64408e9d7ee36465cf) [refactor: remove unused definition and rename arguments for initilizer (#635)](https://github.com/appium/ruby_lib/issues/635)
10
+ - [35d3b11](https://github.com/appium/ruby_lib/commit/35d3b11dafac3363902fc0352a62d957fd90a947) [Alias `quit_driver` to `driver_quit`. (#634)](https://github.com/appium/ruby_lib/issues/634)
11
+ - [214cf72](https://github.com/appium/ruby_lib/commit/214cf72bd8aefffb974d5757d218a668e14a87c7) [fix: Fix android tests and add broken ime methods (#633)](https://github.com/appium/ruby_lib/issues/633)
12
+ - [aaf307d](https://github.com/appium/ruby_lib/commit/aaf307d9bacc30d5c9edb0507d1541ef626d3308) [refactor: loading xcuitest related methods only for XCUITest case (#631)](https://github.com/appium/ruby_lib/issues/631)
13
+ - [20bc86a](https://github.com/appium/ruby_lib/commit/20bc86a5195ef0f6d51ccba68019c1228cd2a0f1) [add extending bridge commands for W3C (#632)](https://github.com/appium/ruby_lib/issues/632)
14
+ - [6288409](https://github.com/appium/ruby_lib/commit/62884095bd59b420c1eb0d9295e9d3f31ca16195) [refactor: set global driver as arguments (#629)](https://github.com/appium/ruby_lib/issues/629)
15
+
16
+
1
17
  #### v9.5.0 2017-08-05
2
18
 
3
19
  - [19177f5](https://github.com/appium/ruby_lib/commit/19177f5348300a0e2e1e0510b99efac2f3067201) [Release 9 5 0 (#628)](https://github.com/appium/ruby_lib/issues/628)
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.6.0
4
+ version: 9.6.1
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-08-19 00:00:00.000000000 Z
11
+ date: 2017-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '1.7'
39
+ version: '1.8'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '1.7'
46
+ version: '1.8'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: json
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -263,8 +263,11 @@ files:
263
263
  - lib/appium_lib/android/helper.rb
264
264
  - lib/appium_lib/android/mobile_methods.rb
265
265
  - lib/appium_lib/android/patch.rb
266
+ - lib/appium_lib/android/uiautomator2.rb
267
+ - lib/appium_lib/android/uiautomator2/element.rb
266
268
  - lib/appium_lib/android/uiautomator2/element/button.rb
267
269
  - lib/appium_lib/android/uiautomator2/helper.rb
270
+ - lib/appium_lib/capabilities.rb
268
271
  - lib/appium_lib/common/command.rb
269
272
  - lib/appium_lib/common/element/window.rb
270
273
  - lib/appium_lib/common/error.rb
@@ -286,6 +289,9 @@ files:
286
289
  - lib/appium_lib/ios/helper.rb
287
290
  - lib/appium_lib/ios/mobile_methods.rb
288
291
  - lib/appium_lib/ios/patch.rb
292
+ - lib/appium_lib/ios/xcuitest.rb
293
+ - lib/appium_lib/ios/xcuitest/command.rb
294
+ - lib/appium_lib/ios/xcuitest/command/pasteboard.rb
289
295
  - lib/appium_lib/ios/xcuitest/device.rb
290
296
  - lib/appium_lib/ios/xcuitest/element.rb
291
297
  - lib/appium_lib/ios/xcuitest/element/button.rb
@@ -294,7 +300,7 @@ files:
294
300
  - lib/appium_lib/ios/xcuitest/element/textfield.rb
295
301
  - lib/appium_lib/ios/xcuitest/gestures.rb
296
302
  - lib/appium_lib/ios/xcuitest/helper.rb
297
- - lib/appium_lib/ios/xcuitest/mobile_methods.rb
303
+ - lib/appium_lib/ios/xcuitest/search_context.rb
298
304
  - lib/appium_lib/logger.rb
299
305
  - readme.md
300
306
  - release_notes.md
@@ -1,23 +0,0 @@
1
- module Appium
2
- module Ios
3
- module Xcuitest
4
- class << self
5
- # @!method ios_class_chain_find
6
- # Only for XCUITest(WebDriverAgent)
7
- # find_element/s can be used with a [class chain]( https://github.com/facebook/WebDriverAgent/wiki/Queries)
8
- #
9
- # ```ruby
10
- # # select the third child button of the first child window element
11
- # find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]'
12
- # # select all the children windows
13
- # find_elements :class_chain, 'XCUIElementTypeWindow'
14
- # # select the second last child of the second child window
15
- # find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]'
16
- # ```
17
- def extended(_mod)
18
- ::Appium::Driver::SearchContext::FINDERS[:class_chain] = '-ios class chain'
19
- end
20
- end
21
- end
22
- end # module Ios
23
- end # module Appium