appium_lib_core 2.0.0 → 2.0.1

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: 60e66f36921180d3073b0976cf869b4b45e0bd18
4
- data.tar.gz: ae0c3edfa4a2980a838925db375bd23a930e0632
3
+ metadata.gz: 17069e6d99a0a9040bc82be1c42745c472afa2db
4
+ data.tar.gz: 64b0bb40b6a6e5f698d3d7d77766553bd5af29e8
5
5
  SHA512:
6
- metadata.gz: 9668a6c5d79ac9a601053701e04352cc5f784feee083e6e9212df4b7abe17013bb388649150c8307bf2b51f3def19cc589b459172e672c79aeeb924d661f567d
7
- data.tar.gz: 7f31ad1475d509bab47e484800d4294dffe37018865a8fd92d9e17de8410853d45a9199bf63f104de5392ef66ad4703dcdda3d43167e61b5e0dc5689274d50a8
6
+ metadata.gz: 8f473836ef122eecaf2a160768ec93c441f2b973f7da3776007e41b7afc6dd6d3d2d81ee9b5dfca648b07811a2c1f92090dd8e19bbeef920af54f5130a358dc6
7
+ data.tar.gz: 1a7dc00a26a22b0d5885432d25f62374c9ecc0d2938a59e7c72258e17c4ad2418469f70044271df799b4160abbcc1b6a13e2834b484b243e385a2619262a204c
@@ -8,6 +8,15 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  ### Deprecations
10
10
 
11
+ ## [2.0.1] - 2018-09-01
12
+ ### Enhancements
13
+ - Add `Appium::Core::Base::Driver#perform_actions` to send multiple actions. See `test_multiple_actions` as an example.
14
+
15
+ ### Bug fixes
16
+ - Fix desired capability for W3C protocol under selenium grid environment [#137](https://github.com/appium/ruby_lib_core/issues/137)
17
+
18
+ ### Deprecations
19
+
11
20
  ## [2.0.0] - 2018-08-25
12
21
 
13
22
  This release has a breaking change for creating core. Thus, I've bumped the major version.
@@ -19,13 +19,13 @@ module Appium
19
19
  # @return [Bridge::MJSONWP, Bridge::W3C]
20
20
  #
21
21
  def self.handshake(**opts)
22
- desired_capabilities = opts.delete(:desired_capabilities)
22
+ desired_capabilities = opts.delete(:desired_capabilities) { ::Selenium::WebDriver::Remote::Capabilities.new }
23
23
 
24
24
  if desired_capabilities.is_a?(Symbol)
25
25
  unless ::Selenium::WebDriver::Remote::Capabilities.respond_to?(desired_capabilities)
26
26
  raise ::Selenium::WebDriver::Error::WebDriverError, "invalid desired capability: #{desired_capabilities.inspect}"
27
27
  end
28
- desired_capabilities = Remote::Capabilities.__send__(desired_capabilities)
28
+ desired_capabilities = ::Selenium::WebDriver::Remote::Capabilities.__send__(desired_capabilities)
29
29
  end
30
30
 
31
31
  bridge = new(opts)
@@ -192,8 +192,7 @@ module Appium
192
192
  {
193
193
  desiredCapabilities: desired_capabilities,
194
194
  capabilities: {
195
- alwaysMatch: w3c_capabilities,
196
- firstMatch: [{}]
195
+ firstMatch: [w3c_capabilities]
197
196
  }
198
197
  }
199
198
  end
@@ -29,6 +29,10 @@ module Appium
29
29
  def take_viewport_screenshot
30
30
  execute_script('mobile: viewportScreenshot')
31
31
  end
32
+
33
+ def send_actions(_data)
34
+ raise Error::UnsupportedOperationError, '#send_actions has not been supported in MJSONWP'
35
+ end
32
36
  end # class MJSONWP
33
37
  end # class Bridge
34
38
  end # class Base
@@ -617,6 +617,40 @@ module Appium
617
617
  @bridge.multi_touch(actions)
618
618
  end
619
619
 
620
+ #
621
+ # Send multiple W3C action chains to server. Use `@driver.action` for single action chain.
622
+ #
623
+ # @param [Array] data Array of actions
624
+ # @return nil|error
625
+ #
626
+ # @example: Zoom
627
+ #
628
+ # f1 = @driver.action.add_pointer_input(:touch, 'finger1')
629
+ # f1.create_pointer_move(duration: 1, x: 200, y: 500,
630
+ # origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
631
+ # f1.create_pointer_down(:left)
632
+ # f1.create_pointer_move(duration: 1, x: 200, y: 200,
633
+ # origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
634
+ # f1.create_pointer_up(:left)
635
+ #
636
+ # f2 = @driver.action.add_pointer_input(:touch, 'finger2')
637
+ # f2.create_pointer_move(duration: 1, x: 200, y: 500,
638
+ # origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
639
+ # f2.create_pointer_down(:left)
640
+ # f2.create_pointer_move(duration: 1, x: 200, y: 800,
641
+ # origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
642
+ # f2.create_pointer_up(:left)
643
+ #
644
+ # @driver.perform_actions [f1, f2] #=> `nil` if the action succeed
645
+ #
646
+ def perform_actions(data)
647
+ raise ArgumentError, "'#{data}' must be Array" unless data.is_a? Array
648
+
649
+ @bridge.send_actions data.map(&:encode).compact
650
+ data.each(&:clear_actions)
651
+ nil
652
+ end
653
+
620
654
  # Get the device window's size.
621
655
  # @return [Selenium::WebDriver::Dimension]
622
656
  #
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Core
3
- VERSION = '2.0.0'.freeze unless defined? ::Appium::Core::VERSION
4
- DATE = '2018-08-25'.freeze unless defined? ::Appium::Core::DATE
3
+ VERSION = '2.0.1'.freeze unless defined? ::Appium::Core::VERSION
4
+ DATE = '2018-09-01'.freeze unless defined? ::Appium::Core::DATE
5
5
  end
6
6
  end
@@ -1,3 +1,13 @@
1
+ #### v2.0.1 2018-09-01
2
+
3
+ - [f0382b5](https://github.com/appium/ruby_lib_core/commit/f0382b5e30a43e187cb47504d82a7a5b6829c1d4) Release 2.0.1
4
+ - [d8e4ba2](https://github.com/appium/ruby_lib_core/commit/d8e4ba2138ee2a914b669d1a10718dbc30781bcb) rename and tweak multiple actions (#141)
5
+ - [de2d747](https://github.com/appium/ruby_lib_core/commit/de2d747a62c0fc118bedc6c4e4fb84f4acb00e5b) add send_actions for w3c multiple actions (#140)
6
+ - [bbbc6f5](https://github.com/appium/ruby_lib_core/commit/bbbc6f559f97aaac9521338a9b2ff5261955362a) fix capabilities for selenium grid (#138)
7
+ - [02a61ce](https://github.com/appium/ruby_lib_core/commit/02a61ce17939fea039f65e8f25092a864b7b12d8) fix rubocop
8
+ - [9439031](https://github.com/appium/ruby_lib_core/commit/9439031445fa23c15463fbf04de157152d2d5b08) add scrolling for ios
9
+
10
+
1
11
  #### v2.0.0 2018-08-25
2
12
 
3
13
  - [6761ec3](https://github.com/appium/ruby_lib_core/commit/6761ec3c29c762ad5617cd42cce4eaa098f81491) Release 2.0.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-25 00:00:00.000000000 Z
11
+ date: 2018-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver