appium_lib_core 1.9.2 → 2.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/README.md +3 -3
- data/lib/appium_lib_core.rb +0 -7
- data/lib/appium_lib_core/common/base/bridge.rb +2 -2
- data/lib/appium_lib_core/common/touch_action/multi_touch.rb +1 -1
- data/lib/appium_lib_core/common/touch_action/touch_actions.rb +1 -1
- data/lib/appium_lib_core/device.rb +1 -1
- data/lib/appium_lib_core/driver.rb +24 -13
- data/lib/appium_lib_core/patch.rb +1 -5
- data/lib/appium_lib_core/version.rb +2 -2
- data/release_notes.md +12 -0
- 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: 60e66f36921180d3073b0976cf869b4b45e0bd18
|
4
|
+
data.tar.gz: ae0c3edfa4a2980a838925db375bd23a930e0632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9668a6c5d79ac9a601053701e04352cc5f784feee083e6e9212df4b7abe17013bb388649150c8307bf2b51f3def19cc589b459172e672c79aeeb924d661f567d
|
7
|
+
data.tar.gz: 7f31ad1475d509bab47e484800d4294dffe37018865a8fd92d9e17de8410853d45a9199bf63f104de5392ef66ad4703dcdda3d43167e61b5e0dc5689274d50a8
|
data/CHANGELOG.md
CHANGED
@@ -8,11 +8,25 @@ All notable changes to this project will be documented in this file.
|
|
8
8
|
|
9
9
|
### Deprecations
|
10
10
|
|
11
|
+
## [2.0.0] - 2018-08-25
|
12
|
+
|
13
|
+
This release has a breaking change for creating core. Thus, I've bumped the major version.
|
14
|
+
|
15
|
+
### Enhancements
|
16
|
+
- use `autoload` to load Android/iOS modules
|
17
|
+
|
18
|
+
### Bug fixes
|
19
|
+
|
20
|
+
### Deprecations
|
21
|
+
- `@core = Appium::Core.for(self, opts)` is deprecated in favor of `@core = Appium::Core.for(opts)`
|
22
|
+
- Call `extend Appium::Core::Device` if you'd like to extend methods defined in `Appium::Core`
|
23
|
+
- Read [#816](https://github.com/appium/ruby_lib/pull/816) as an example
|
24
|
+
|
11
25
|
## [1.9.2] - 2018-08-23
|
12
26
|
### Enhancements
|
13
27
|
|
14
28
|
### Bug fixes
|
15
|
-
- fix unexpedted method missing against `:to_hash`
|
29
|
+
- fix unexpedted method missing against `:to_hash` in Element
|
16
30
|
|
17
31
|
### Deprecations
|
18
32
|
|
data/README.md
CHANGED
@@ -27,8 +27,8 @@ Run functional tests which require the Appium server and real device, Simulator/
|
|
27
27
|
|
28
28
|
- Start Appium server
|
29
29
|
```bash
|
30
|
-
$ npm install -g appium
|
31
|
-
$ appium
|
30
|
+
$ npm install -g appium opencv4nodejs
|
31
|
+
$ appium --relaxed-security # To run all tests in rocal
|
32
32
|
```
|
33
33
|
|
34
34
|
- Conduct tests
|
@@ -68,7 +68,7 @@ opts = {
|
|
68
68
|
wait: 30
|
69
69
|
}
|
70
70
|
}
|
71
|
-
@core = Appium::Core.for(
|
71
|
+
@core = Appium::Core.for(opts) # create a core driver with `opts`
|
72
72
|
@driver = @core.start_driver
|
73
73
|
|
74
74
|
# Launch iPhone Simulator and `MyiOS.app`
|
data/lib/appium_lib_core.rb
CHANGED
@@ -6,13 +6,6 @@ require_relative 'appium_lib_core/driver'
|
|
6
6
|
|
7
7
|
require_relative 'appium_lib_core/device'
|
8
8
|
|
9
|
-
require_relative 'appium_lib_core/android'
|
10
|
-
require_relative 'appium_lib_core/android_uiautomator2'
|
11
|
-
require_relative 'appium_lib_core/android_espresso'
|
12
|
-
|
13
|
-
require_relative 'appium_lib_core/ios'
|
14
|
-
require_relative 'appium_lib_core/ios_xcuitest'
|
15
|
-
|
16
9
|
# Call patch after requiring other files
|
17
10
|
require_relative 'appium_lib_core/patch'
|
18
11
|
|
@@ -67,7 +67,7 @@ module Appium
|
|
67
67
|
# wait: 30
|
68
68
|
# }
|
69
69
|
# }
|
70
|
-
# core = ::Appium::Core.for(
|
70
|
+
# core = ::Appium::Core.for(caps)
|
71
71
|
# driver = core.start_driver #=> driver.dialect == :oss
|
72
72
|
#
|
73
73
|
# @example
|
@@ -85,7 +85,7 @@ module Appium
|
|
85
85
|
# wait: 30
|
86
86
|
# }
|
87
87
|
# }
|
88
|
-
# core = ::Appium::Core.for(
|
88
|
+
# core = ::Appium::Core.for(caps)
|
89
89
|
# driver = core.start_driver #=> driver.dialect == :w3c if the Appium server support W3C.
|
90
90
|
#
|
91
91
|
def create_session(desired_capabilities)
|
@@ -9,7 +9,7 @@ module Appium
|
|
9
9
|
#
|
10
10
|
# @example
|
11
11
|
#
|
12
|
-
# @driver = Appium::Core.for(
|
12
|
+
# @driver = Appium::Core.for(opts).start_driver
|
13
13
|
# action_1 = TouchAction.new(@driver).press(x: 45, y: 100).wait(5).release
|
14
14
|
# action_2 = TouchAction.new(@driver).tap(element: el, x: 50, y:5, count: 3)
|
15
15
|
#
|
@@ -12,7 +12,7 @@ module Appium
|
|
12
12
|
#
|
13
13
|
# @example
|
14
14
|
#
|
15
|
-
# @driver = Appium::Core.for(
|
15
|
+
# @driver = Appium::Core.for(opts).start_driver
|
16
16
|
# action = TouchAction.new(@driver).press(x: 45, y: 100).wait(5).release
|
17
17
|
# action.perform
|
18
18
|
# action = TouchAction.new(@driver).swipe(....)
|
@@ -7,7 +7,7 @@ module Appium
|
|
7
7
|
def extended(_mod)
|
8
8
|
extend_webdriver_with_forwardable
|
9
9
|
|
10
|
-
# Compatibility for appium_lib
|
10
|
+
# Compatibility for appium_lib. Below command are extended by `extend Appium::Core::Deivce`in appium_lib.
|
11
11
|
# TODO: Will remove
|
12
12
|
[
|
13
13
|
:take_element_screenshot, :save_viewport_screenshot,
|
@@ -2,6 +2,17 @@ require 'uri'
|
|
2
2
|
|
3
3
|
module Appium
|
4
4
|
module Core
|
5
|
+
module Android
|
6
|
+
autoload :Uiautomator1, 'appium_lib_core/android'
|
7
|
+
autoload :Uiautomator2, 'appium_lib_core/android_uiautomator2'
|
8
|
+
autoload :Espresso, 'appium_lib_core/android_espresso'
|
9
|
+
end
|
10
|
+
|
11
|
+
module Ios
|
12
|
+
autoload :Uiautomation, 'appium_lib_core/ios'
|
13
|
+
autoload :Xcuitest, 'appium_lib_core/ios_xcuitest'
|
14
|
+
end
|
15
|
+
|
5
16
|
class Driver
|
6
17
|
include Waitable
|
7
18
|
# Selenium webdriver capabilities
|
@@ -92,7 +103,7 @@ module Appium
|
|
92
103
|
# listener: nil,
|
93
104
|
# }
|
94
105
|
# }
|
95
|
-
# @core = Appium::Core.for(
|
106
|
+
# @core = Appium::Core.for(opts) # create a core driver with `opts` and extend methods into `self`
|
96
107
|
# @core.start_driver(server_url: server_url) # start driver
|
97
108
|
#
|
98
109
|
# # Start iOS driver with .zip file over HTTP
|
@@ -114,11 +125,11 @@ module Appium
|
|
114
125
|
# listener: nil,
|
115
126
|
# }
|
116
127
|
# }
|
117
|
-
# @core = Appium::Core.for(
|
128
|
+
# @core = Appium::Core.for(opts)
|
118
129
|
# @core.start_driver(server_url: server_url)
|
119
130
|
#
|
120
|
-
def self.for(
|
121
|
-
new(
|
131
|
+
def self.for(opts = {})
|
132
|
+
new(opts)
|
122
133
|
end
|
123
134
|
|
124
135
|
# @private
|
@@ -128,8 +139,8 @@ module Appium
|
|
128
139
|
end
|
129
140
|
|
130
141
|
# @private
|
131
|
-
def initialize(
|
132
|
-
@delegate_target =
|
142
|
+
def initialize(opts = {})
|
143
|
+
@delegate_target = self # for testing purpose
|
133
144
|
|
134
145
|
opts = Appium.symbolize_keys opts
|
135
146
|
validate_keys(opts)
|
@@ -141,7 +152,7 @@ module Appium
|
|
141
152
|
set_appium_device
|
142
153
|
set_automation_name
|
143
154
|
|
144
|
-
extend_for(device: @device, automation_name: @automation_name
|
155
|
+
extend_for(device: @device, automation_name: @automation_name)
|
145
156
|
|
146
157
|
self # rubocop:disable Lint/Void
|
147
158
|
end
|
@@ -179,8 +190,8 @@ module Appium
|
|
179
190
|
# }
|
180
191
|
# }
|
181
192
|
#
|
182
|
-
# @core = Appium::Core.for(
|
183
|
-
# @driver = @core.start_driver
|
193
|
+
# @core = Appium::Core.for(opts) # create a core driver with `opts` and extend methods into `self`
|
194
|
+
# @driver = @core.start_driver server_url: "http://127.0.0.1:8000/wd/hub"
|
184
195
|
#
|
185
196
|
|
186
197
|
def start_driver(server_url: nil,
|
@@ -307,9 +318,9 @@ module Appium
|
|
307
318
|
private
|
308
319
|
|
309
320
|
# @private
|
310
|
-
def extend_for(device:, automation_name
|
311
|
-
|
312
|
-
|
321
|
+
def extend_for(device:, automation_name:)
|
322
|
+
extend Appium::Core
|
323
|
+
extend Appium::Core::Device
|
313
324
|
|
314
325
|
case device
|
315
326
|
when :android
|
@@ -341,7 +352,7 @@ module Appium
|
|
341
352
|
Appium::Logger.warn('no device matched')
|
342
353
|
end
|
343
354
|
|
344
|
-
|
355
|
+
self
|
345
356
|
end
|
346
357
|
|
347
358
|
# @private
|
@@ -29,14 +29,10 @@ module Appium
|
|
29
29
|
# e.resource_id # call `e.attribute "resource-id"`
|
30
30
|
#
|
31
31
|
def method_missing(method_name)
|
32
|
-
white_list = [:content_desc, :long_clickable, :resource_id, :selection_start, :selection_end]
|
33
|
-
attribute_name = white_list.include?(method_name) ? method_name.to_s.tr('_', '-') : method_name
|
34
|
-
|
35
32
|
ignore_list = [:to_hash]
|
36
|
-
|
37
33
|
return if ignore_list.include? method_name
|
38
34
|
|
39
|
-
respond_to?(method_name) ? attribute(
|
35
|
+
respond_to?(method_name) ? attribute(method_name.to_s.tr('_', '-')) : super
|
40
36
|
end
|
41
37
|
|
42
38
|
def respond_to_missing?(*)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Core
|
3
|
-
VERSION = '
|
4
|
-
DATE = '2018-08-
|
3
|
+
VERSION = '2.0.0'.freeze unless defined? ::Appium::Core::VERSION
|
4
|
+
DATE = '2018-08-25'.freeze unless defined? ::Appium::Core::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
#### v2.0.0 2018-08-25
|
2
|
+
|
3
|
+
- [6761ec3](https://github.com/appium/ruby_lib_core/commit/6761ec3c29c762ad5617cd42cce4eaa098f81491) Release 2.0.0
|
4
|
+
- [e2feb5e](https://github.com/appium/ruby_lib_core/commit/e2feb5e864358ed4eb4cb61914724c1d951c34ce) get rid of self from Appium::Core.for(self, opts) (#136)
|
5
|
+
- [b1c7137](https://github.com/appium/ruby_lib_core/commit/b1c7137bebe1fc1eed869c12eecece493e206c7b) use autoload (#135)
|
6
|
+
- [04dc656](https://github.com/appium/ruby_lib_core/commit/04dc656486d1b19d6ea63c1f9dd8e8ab51c26e86) separate unit tests
|
7
|
+
- [1174ad1](https://github.com/appium/ruby_lib_core/commit/1174ad1cd08091277547fb12ca5bdb7f571d9ab3) separate test cases
|
8
|
+
- [862e587](https://github.com/appium/ruby_lib_core/commit/862e587c50171e35d04f6a5c0645bf6159dfad96) Update tests for espresso aswell (#134)
|
9
|
+
- [80c7b1b](https://github.com/appium/ruby_lib_core/commit/80c7b1bc5660ce32b939b237c38ffd5ef34d75e3) just return missing methods (#133)
|
10
|
+
- [a1b7591](https://github.com/appium/ruby_lib_core/commit/a1b7591c4be8bbcea6449e8af33c20cf081b8545) tweak changelog
|
11
|
+
|
12
|
+
|
1
13
|
#### v1.9.2 2018-08-23
|
2
14
|
|
3
15
|
- [2c6ac55](https://github.com/appium/ruby_lib_core/commit/2c6ac55a0d351a6801ff2c4b80988adcdd8b44c8) Release 1.9.2
|
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:
|
4
|
+
version: 2.0.0
|
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-
|
11
|
+
date: 2018-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|