appium_lib_core 2.3.1 → 2.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c10b3d610607f773263b41a6fcc8a1ef3486214
4
- data.tar.gz: 36827f23fa7146ef3311e5b87ec3154cbea0b70b
3
+ metadata.gz: 33533e8d7934610ad0c43c6957765e40aab65f45
4
+ data.tar.gz: e73ee98770907974b2220e57f9b949bd657d9beb
5
5
  SHA512:
6
- metadata.gz: ad6af80ee422db86a404ab8fb5fce1ce832c10e2c7cd0f90c4fca6e9a87796bea12a9e8cbd6f47591d1bbf23194fffa013877dd3d0ac69f4ea286b3789762152
7
- data.tar.gz: 2798ad4bb81887889cbb2e393aa6546b3c1830eb85006128645faeafe565b5cd1f11ed2eb38185452cb6fbed9d24a2ac268eb9cfc89d70e7add781ec5bfd7038
6
+ metadata.gz: aaac599d8a33199041357f09d9ddb9355c1bb8bc6c0b04f8edbed7ebb5ed39c7caf99fd7f9254e939b1f5392582c6738f467039fb0982542a8132a40b279c668
7
+ data.tar.gz: 58b70225c898eba780f5f4df8fc7d8ad1ed3edbe5e51b62df6f547774a2295e297d9a41efff8c3aed59f5354d6433e4a3910acd23b57464fe4bf18ca6f4a2cdb
data/CHANGELOG.md CHANGED
@@ -9,6 +9,18 @@ Read `release_notes.md` for commit level details.
9
9
 
10
10
  ### Deprecations
11
11
 
12
+ ## [2.3.2] - 2019-01-20
13
+ ### Enhancements
14
+ - Add alias for some method calls
15
+ 1. IME: e.g. `@driver.ime.activate` in addition to `@driver.ime_activate` [rubydoc](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Base/Driver#ime-instance_method)
16
+ 2. Settings: e.g. `@driver.settings = { ... }` and `@driver.settings.update(...)` in addition to `@driver.update_settings(...)` [rubydoc](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Base/Driver#settings-instance_method)
17
+ 3. Locked: `@driver.locked?` in addition to `@driver.device_locked?`
18
+
19
+ ### Bug fixes
20
+ - Inherit CoreError for ServerError in order to handle it as an exception
21
+
22
+ ### Deprecations
23
+
12
24
  ## [2.3.1] - 2019-01-13
13
25
  ### Enhancements
14
26
  - `set_network_connection` accepts keys as same as `network_connection_type` in addition to numbers
@@ -57,10 +57,12 @@ module Appium
57
57
  # @example
58
58
  #
59
59
  # @driver.device_locked?
60
+ # @driver.locked?
60
61
  #
61
- def device_locked?
62
+ def locked?
62
63
  @bridge.device_locked?
63
64
  end
65
+ alias device_locked? locked?
64
66
 
65
67
  # Unlock the device
66
68
  #
@@ -115,56 +117,136 @@ module Appium
115
117
  end
116
118
  alias type send_keys
117
119
 
118
- # Get appium Settings for current test session
120
+ class DriverSettings
121
+ # @private this class is private
122
+ def initialize(bridge)
123
+ @bridge = bridge
124
+ end
125
+
126
+ def get
127
+ @bridge.get_settings
128
+ end
129
+
130
+ def update(settings)
131
+ @bridge.update_settings(settings)
132
+ end
133
+ end
134
+ private_constant :DriverSettings
135
+
136
+ # Returns an instance of DriverSettings to call get/update.
137
+ #
138
+ # @example
139
+ #
140
+ # @driver.settings.get
141
+ # @driver.settings.update('allowInvisibleElements': true)
142
+ #
143
+ def settings
144
+ @driver_settings ||= DriverSettings.new(@bridge)
145
+ end
146
+
147
+ # Get appium Settings for current test session.
148
+ # Alias of @driver.settings.get
119
149
  #
120
150
  # @example
121
151
  #
122
152
  # @driver.get_settings
153
+ # @driver.settings.get
123
154
  #
124
155
  def get_settings
125
- @bridge.get_settings
156
+ settings.get
126
157
  end
127
158
 
128
159
  # Update Appium Settings for current test session
129
- # @param [Hash] settings Settings to update, keys are settings, values to value to set each setting to
160
+ # Alias of @driver.settings#update
161
+ #
162
+ # @param [Hash] value Settings to update, keys are settings, values to value to set each setting to
130
163
  #
131
164
  # @example
132
165
  #
133
166
  # @driver.update_settings('allowInvisibleElements': true)
167
+ # @driver.settings.update('allowInvisibleElements': true)
168
+ # @driver.settings = { 'allowInvisibleElements': true }
169
+ #
170
+ def settings=(value)
171
+ settings.update(value)
172
+ end
173
+ alias update_settings settings=
174
+
175
+ class DeviceIME
176
+ # @private this class is private
177
+ def initialize(bridge)
178
+ @bridge = bridge
179
+ end
180
+
181
+ def activate(ime_name)
182
+ @bridge.ime_activate(ime_name)
183
+ end
184
+
185
+ def available_engines
186
+ @bridge.ime_available_engines
187
+ end
188
+
189
+ def active_engine
190
+ @bridge.ime_active_engine
191
+ end
192
+
193
+ def activated?
194
+ @bridge.ime_activated
195
+ end
196
+
197
+ def deactivate
198
+ @bridge.ime_deactivate
199
+ end
200
+ end
201
+ private_constant :DeviceIME
202
+
203
+ # Returns an instance of DeviceIME
134
204
  #
135
- def update_settings(settings)
136
- @bridge.update_settings(settings)
205
+ # @example
206
+ #
207
+ # @driver.ime.activate engine: 'com.android.inputmethod.latin/.LatinIME'
208
+ # @driver.ime.available_engines #=> Get the list of IME installed in the target device
209
+ # @driver.ime.active_engine #=> Get the current active IME such as 'com.android.inputmethod.latin/.LatinIME'
210
+ # @driver.ime.activated #=> True if IME is activated
211
+ # @driver.ime.deactivate #=> Deactivate current IME engine
212
+ #
213
+ def ime
214
+ @device_ime ||= DeviceIME.new(@bridge)
137
215
  end
138
216
 
139
217
  # Android only. Make an engine that is available active.
218
+ #
140
219
  # @param [String] ime_name The IME owning the activity [required]
141
220
  #
142
221
  # @example
143
222
  #
144
- # ime_activate engine: 'com.android.inputmethod.latin/.LatinIME'
223
+ # @driver.ime_activate engine: 'com.android.inputmethod.latin/.LatinIME'
224
+ # @driver.ime.activate engine: 'com.android.inputmethod.latin/.LatinIME'
145
225
  #
146
226
  def ime_activate(ime_name)
147
- @bridge.ime_activate(ime_name)
227
+ ime.activate(ime_name)
148
228
  end
149
229
 
150
230
  # Android only. List all available input engines on the machine.
151
231
  #
152
232
  # @example
153
233
  #
154
- # ime_available_engines #=> Get the list of IME installed in the target device
234
+ # @driver.ime_available_engines #=> Get the list of IME installed in the target device
235
+ # @driver.ime.available_engines #=> Get the list of IME installed in the target device
155
236
  #
156
237
  def ime_available_engines
157
- @bridge.ime_available_engines
238
+ ime.available_engines
158
239
  end
159
240
 
160
241
  # Android only. Get the name of the active IME engine.
161
242
  #
162
243
  # @example
163
244
  #
164
- # ime_active_engine #=> Get the current active IME such as 'com.android.inputmethod.latin/.LatinIME'
245
+ # @driver.ime_active_engine #=> Get the current active IME such as 'com.android.inputmethod.latin/.LatinIME'
246
+ # @driver.ime.active_engine #=> Get the current active IME such as 'com.android.inputmethod.latin/.LatinIME'
165
247
  #
166
248
  def ime_active_engine
167
- @bridge.ime_active_engine
249
+ ime.active_engine
168
250
  end
169
251
 
170
252
  # @!method ime_activated
@@ -172,20 +254,22 @@ module Appium
172
254
  #
173
255
  # @example
174
256
  #
175
- # ime_activated #=> True if IME is activated
257
+ # @driver.ime_activated #=> True if IME is activated
258
+ # @driver.ime.activated #=> True if IME is activated
176
259
  #
177
260
  def ime_activated
178
- @bridge.ime_activated
261
+ ime.activated?
179
262
  end
180
263
 
181
264
  # Android only. De-activates the currently-active IME engine.
182
265
  #
183
266
  # @example
184
267
  #
185
- # ime_deactivate #=> Deactivate current IME engine
268
+ # @driver.ime_deactivate #=> Deactivate current IME engine
269
+ # @driver.ime.deactivate #=> Deactivate current IME engine
186
270
  #
187
271
  def ime_deactivate
188
- @bridge.ime_deactivate
272
+ ime.deactivate
189
273
  end
190
274
 
191
275
  # Perform a block within the given context, then switch back to the starting context.
@@ -14,7 +14,7 @@ module Appium
14
14
  class UnsupportedOperationError < CoreError; end
15
15
 
16
16
  # Server side error
17
- class ServerError; end
17
+ class ServerError < CoreError; end
18
18
  end
19
19
  end
20
20
  end
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Core
3
- VERSION = '2.3.1'.freeze unless defined? ::Appium::Core::VERSION
4
- DATE = '2019-01-13'.freeze unless defined? ::Appium::Core::DATE
3
+ VERSION = '2.3.2'.freeze unless defined? ::Appium::Core::VERSION
4
+ DATE = '2019-01-20'.freeze unless defined? ::Appium::Core::DATE
5
5
  end
6
6
  end
data/release_notes.md CHANGED
@@ -1,3 +1,12 @@
1
+ #### v2.3.2 2019-01-20
2
+
3
+ - [77aa44a](https://github.com/appium/ruby_lib_core/commit/77aa44a930335d64dd8f8107f93f131f4983c578) Release 2.3.2
4
+ - [d6967b1](https://github.com/appium/ruby_lib_core/commit/d6967b193cc4b5d040bccf6290fadc566c14aa3b) Add alias for ime, settings and device locked (#183)
5
+ - [9abb158](https://github.com/appium/ruby_lib_core/commit/9abb158510ce871d4d3a2b35eb3aed7e43344c20) Server error (#182)
6
+ - [76b1cc2](https://github.com/appium/ruby_lib_core/commit/76b1cc2d42e953b6dc7800549ad664262acca717) add a comment for creating session without deleting previous session
7
+ - [e304e54](https://github.com/appium/ruby_lib_core/commit/e304e54c9e0c5e043fdb943c7eff952d2cd5a1fe) add teardown
8
+
9
+
1
10
  #### v2.3.1 2019-01-13
2
11
 
3
12
  - [12ace90](https://github.com/appium/ruby_lib_core/commit/12ace906df63a8e4d4377b402ada2d90bd7509af) Release 2.3.1
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.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-13 00:00:00.000000000 Z
11
+ date: 2019-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver