appium_lib_core 4.1.0 → 4.2.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
  SHA256:
3
- metadata.gz: 5328494c785b852424a9ba61e627ed78c54c4bca6baf2643f16a647f4edfcf22
4
- data.tar.gz: 130869ab5ca0d2967f98b5beed348d3e31bb7c90eb5219da60f2d8f973e8a381
3
+ metadata.gz: a3f77d23abb2c69ab5b4f5f733a9b901002f8d5fe24e8b99ad8ef03df1dcad99
4
+ data.tar.gz: 7acc05e37be676c753e2c0d7519c9882d13eb55bdef32678dd3b44458120e487
5
5
  SHA512:
6
- metadata.gz: 48aae8b8e934edac9f178cc365825605fc40c7ff63a36e8e7cfe7baf7c815ec89dfecf60350dff401dcfdac80f1e892c86022659b65fc7000c55f7e4fa3b0243
7
- data.tar.gz: 4cc0a6c8eb8b1258a6e7df79666ed4dd21cf3f6cae8c613fd5e3a34a11f15f7614151f296931205bc55d2c817cef298d682e6eb6dc95fb3ee826a864d39350f2
6
+ metadata.gz: 3ea82009235de78bedd7a03e4de1021fed4fcb5a21a878697fe4b3dde281d1d36976a2cc6e63dc5d2735cabbe8328f49de3d06f1568ffc48eebbb80144c69d5a
7
+ data.tar.gz: 4bee50ff9e195d09b634a3ff7420d04ca1ab896d26d9523a40f20ae2db7c6d2d4b81450dee4f2b0e225599e9e1a774c0e5cb19acc6d89bfeb01bd859caecfe6e
data/CHANGELOG.md CHANGED
@@ -5,69 +5,59 @@ Read `release_notes.md` for commit level details.
5
5
  ## [Unreleased]
6
6
 
7
7
  ### Enhancements
8
- - Ruby 3.0 support
9
8
 
10
9
  ### Bug fixes
11
10
 
12
11
  ### Deprecations
13
12
 
14
- ## [4.1.0] - 2020-12-25
13
+ ## [4.2.1] - 2021-01-10
15
14
 
16
15
  ### Enhancements
17
- - Ruby 3.0 support
16
+ - Refactor routable
18
17
 
19
- ### Bug fixes
20
-
21
- ### Deprecations
18
+ ## [4.2.0] - 2021-01-02
22
19
 
23
- ## [4.0.0] - 2020-12-19
20
+ ### Enhancements
21
+ - Add `Element#screenshot`, `Element#screenshot_as` and `Element#save_screenshot` in Element module
22
+ - `Element#screenshot_as` and `Element#save_screenshot` are same as `Driver#element_screenshot_as` and `Driver#save_element_screenshot`
23
+ - `Element#screenshot` is same as `Element#screenshot_as(:base64)`
24
24
 
25
- Supported Ruby version is 2.4+
25
+ ## [4.1.1] - 2020-12-25
26
26
 
27
27
  ### Enhancements
28
+ - Ruby 3.0 support
29
+ - Arguments in `@driver.execute_cdp`
30
+ - It should be like `@driver.execute_cdp 'Page.captureScreenshot', quality: 50, format: 'jpeg'` as keyword arguments
31
+ instead of `@driver.execute_cdp 'Page.captureScreenshot', { quality: 50, format: 'jpeg' }` in Ruby 3
28
32
 
29
- ### Bug fixes
33
+ ## [4.0.0] - 2020-12-19
34
+
35
+ Supported Ruby version is 2.4+
30
36
 
31
37
  ### Deprecations
32
38
  - No longer work with `forceMjsonwp` capability to force the session MJSONWP
33
39
 
34
40
  ## [3.11.1] - 2020-11-20
35
41
 
36
- ### Enhancements
37
-
38
42
  ### Bug fixes
39
43
  - Fix `install_app` to be able to set no args for options
40
44
 
41
- ### Deprecations
42
-
43
45
  ## [3.11.0] - 2020-08-01
44
46
 
45
47
  ### Enhancements
46
48
  - Security update [GHSA-2v5c-755p-p4gv](https://github.com/advisories/GHSA-2v5c-755p-p4gv)
47
49
  - Affects only _::Appium::Core::WebSocket_
48
50
 
49
- ### Bug fixes
50
-
51
- ### Deprecations
52
-
53
51
  ## [3.10.1] - 2020-06-29
54
52
 
55
- ### Enhancements
56
-
57
53
  ### Bug fixes
58
54
  - Fix duplication warning of `execute_cdp`
59
55
 
60
- ### Deprecations
61
-
62
56
  ## [3.10.0] - 2020-06-09
63
57
 
64
58
  ### Enhancements
65
59
  - Remove deprecated `Selenium::WebDriver::Error::TimeOutError`
66
60
 
67
- ### Bug fixes
68
-
69
- ### Deprecations
70
-
71
61
  ## [3.9.0] - 2020-05-31
72
62
 
73
63
  ### Enhancements
@@ -86,10 +76,6 @@ Supported Ruby version is 2.4+
86
76
  @driver = Appium::Core.for(opts).start_driver
87
77
  ```
88
78
 
89
- ### Bug fixes
90
-
91
- ### Deprecations
92
-
93
79
  ## [3.8.0] - 2020-05-17
94
80
 
95
81
  ### Enhancements
@@ -99,8 +85,6 @@ Supported Ruby version is 2.4+
99
85
  ### Bug fixes
100
86
  - Fix `x-idempotency-key` header to add it only in new session request (https://github.com/appium/ruby_lib_core/issues/262)
101
87
 
102
- ### Deprecations
103
-
104
88
  ## [3.7.0] - 2020-04-18
105
89
 
106
90
  ### Enhancements
@@ -109,76 +93,44 @@ Supported Ruby version is 2.4+
109
93
  - Add chrome devtools endpoint which is available chrome module in Selenium Ruby binding
110
94
  - https://github.com/appium/appium-base-driver/pull/405
111
95
 
112
- ### Bug fixes
113
-
114
- ### Deprecations
115
-
116
96
  ## [3.6.1, 3.6.0] - 2020-03-15
117
97
 
118
98
  ### Enhancements
119
99
  - Add screen record feature for Windows driver (https://github.com/appium/appium-windows-driver/pull/66)
120
100
  - `#start_recording_screen`, `#stop_recording_screen`
121
101
 
122
- ### Bug fixes
123
-
124
- ### Deprecations
125
-
126
102
  ## [3.5.0] - 2020-01-11
127
103
 
128
104
  ### Enhancements
129
105
  - Add `:viewmatcher` selector like `@driver.find_elements :view_matcher, { name: 'withText', args: %w(Accessibility), class: 'androidx.test.espresso.matcher.ViewMatchers' }`
130
106
 
131
- ### Bug fixes
132
-
133
- ### Deprecations
134
-
135
107
  ## [3.4.2] - 2019-12-29
136
108
 
137
109
  ### Enhancements
138
110
  - Add `attr_reader :bridge` for flutter driver not to use `send`
139
111
  - https://github.com/truongsinh/appium-flutter-driver/pull/35
140
112
 
141
- ### Bug fixes
142
-
143
- ### Deprecations
144
-
145
113
  ## [3.4.0, 3.4.1] - 2019-12-26, 2019-12-27
146
114
 
147
115
  ### Enhancements
148
116
  - Fix Ruby 2.7 warnings
149
117
 
150
- ### Bug fixes
151
-
152
- ### Deprecations
153
-
154
118
  ## [3.3.0] - 2019-11-08
155
119
 
156
120
  ### Enhancements
157
121
  - Add `Logs#event` to post a custom log by `@driver.logs.event vendor: 'appium', event: 'funEvent'`
158
122
  - Add `Logs#events` to get events by `@driver.logs.events`. It is equal to `@driver.session_capabilities['events']`
159
123
 
160
- ### Bug fixes
161
-
162
- ### Deprecations
163
-
164
124
  ## [3.2.3] - 2019-09-30
165
125
 
166
126
  ### Enhancements
167
127
  - Add `system_bars` as an alias to `get_system_bars`
168
128
 
169
- ### Bug fixes
170
-
171
- ### Deprecations
172
-
173
129
  ## [3.2.2] - 2019-08-04
174
130
 
175
- ### Enhancements
176
-
177
131
  ### Bug fixes
178
132
  - Fixed parameters of `remove_app`
179
133
 
180
- ### Deprecations
181
-
182
134
  ## [3.2.1] - 2019-07-19
183
135
 
184
136
  ### Enhancements
@@ -200,39 +152,23 @@ Supported Ruby version is 2.4+
200
152
  - Add `execute_driver` to run a batch script
201
153
  - It requires Appium version which has `execute_driver` support
202
154
 
203
- ### Bug fixes
204
-
205
- ### Deprecations
206
-
207
155
  ## [3.1.3] - 2019-06-18
208
156
 
209
157
  ### Enhancements
210
158
  - Add arguments for `start_activity`
211
159
  - `intentAction`, `intentCategory`, `intentFlags`, `dontStopAppOnReset`
212
160
 
213
- ### Bug fixes
214
-
215
- ### Deprecations
216
-
217
161
  ## [3.1.2] - 2019-05-10
218
162
 
219
163
  ### Enhancements
220
164
  - Add `sessions` command to get all available sessions on the Appium server
221
165
  - [internal] Tweak error messages in emulator module
222
166
 
223
- ### Bug fixes
224
-
225
- ### Deprecations
226
-
227
167
  ## [3.1.1] - 2019-04-26
228
168
 
229
169
  ### Enhancements
230
170
  - [internal] Catch `Selenium::WebDriver::Error::TimeoutError` which will be used instead of `Selenium::WebDriver::Error::TimeOutError`
231
171
 
232
- ### Bug fixes
233
-
234
- ### Deprecations
235
-
236
172
  ## [3.1.0] - 2019-03-31
237
173
 
238
174
  ### Enhancements
@@ -240,28 +176,16 @@ Supported Ruby version is 2.4+
240
176
  - `platformName: :tvos, automationName: :xcuitest` can work for iOS tvOS
241
177
  - It requires Appium 1.13
242
178
 
243
- ### Bug fixes
244
-
245
- ### Deprecations
246
-
247
179
  ## [3.0.4] - 2019-03-24
248
180
 
249
181
  ### Enhancements
250
182
  - Add `pixelFormat` argument in screen record for iOS
251
183
 
252
- ### Bug fixes
253
-
254
- ### Deprecations
255
-
256
184
  ## [3.0.3] - 2019-03-11
257
185
 
258
186
  ### Enhancements
259
187
  - [internal] Bump Rubocop target Ruby version to Ruby 2.3
260
188
 
261
- ### Bug fixes
262
-
263
- ### Deprecations
264
-
265
189
  ## [3.0.2] - 2019-03-07
266
190
 
267
191
  ### Enhancements
@@ -271,17 +195,11 @@ Supported Ruby version is 2.4+
271
195
  - [internal] Fixed typo in `Emulator#gsm_signal` [#196](https://github.com/appium/ruby_lib_core/pull/196)
272
196
  - Thanks [khanhdodang](https://github.com/khanhdodang)
273
197
 
274
- ### Deprecations
275
-
276
198
  ## [3.0.1] - 2019-02-25
277
199
 
278
200
  ### Enhancements
279
201
  - Add `:data_matcher` find_element/s attribute [appium-espresso-driver#386](https://github.com/appium/appium-espresso-driver/pull/386)
280
202
 
281
- ### Bug fixes
282
-
283
- ### Deprecations
284
-
285
203
  ## [3.0.0] - 2019-02-06
286
204
 
287
205
  This release has a breaking change about an implicit wait.
@@ -307,8 +225,6 @@ The behaviour follows the default spec in WebDriver.
307
225
  ### Bug fixes
308
226
  - Fix potential override of `AppManagement#background_app` [#188](https://github.com/appium/ruby_lib_core/pull/188)
309
227
 
310
- ### Deprecations
311
-
312
228
  ## [2.3.4] - 2019-01-31
313
229
  ### Enhancements
314
230
  - Add 3D touch option for `TouchAction#press` [appium/WebDriverAgent#79](https://github.com/appium/WebDriverAgent/pull/79)
@@ -317,16 +233,10 @@ The behaviour follows the default spec in WebDriver.
317
233
  ### Bug fixes
318
234
  - Stop sending blank value in `start_activity`
319
235
 
320
- ### Deprecations
321
-
322
236
  ## [2.3.3] - 2019-01-22
323
- ### Enhancements
324
-
325
237
  ### Bug fixes
326
238
  - Add `*args, &block` in method missing in `Selenium::WebDriver::Element` [#184](https://github.com/appium/ruby_lib_core/pull/184)
327
239
 
328
- ### Deprecations
329
-
330
240
  ## [2.3.2] - 2019-01-20
331
241
  ### Enhancements
332
242
  - Add alias for some method calls
@@ -337,18 +247,12 @@ The behaviour follows the default spec in WebDriver.
337
247
  ### Bug fixes
338
248
  - `ServerError` inherits `CoreError` in order to handle it as an exception
339
249
 
340
- ### Deprecations
341
-
342
250
  ## [2.3.1] - 2019-01-13
343
251
  ### Enhancements
344
252
  - `set_network_connection` accepts keys as same as `network_connection_type` in addition to numbers
345
253
  - `{ :airplane_mode: 1, wifi: 2, data: 4, all: 6, none: 0 }`
346
254
  - Read [documentation](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device#set_network_connection-instance_method) more
347
255
 
348
- ### Bug fixes
349
-
350
- ### Deprecations
351
-
352
256
  ## [2.3.0] - 2019-01-07
353
257
  ### Enhancements
354
258
  - Use `Base64.strict_encode64` when this client sends `Base64` encoded data to server
@@ -356,33 +260,19 @@ The behaviour follows the default spec in WebDriver.
356
260
  - Continues to decode base 64 data following `decode64` to accept RFC 2045 format
357
261
  - Add `query_app_state` as an alias of `app_state` to get application status
358
262
 
359
- ### Bug fixes
360
-
361
- ### Deprecations
362
-
363
263
  ## [2.2.2] - 2018-12-22
364
264
  ### Enhancements
365
265
  - Append `appium` in header: `appium/ruby_lib_core/2.2.1 (selenium/3.141.0 (ruby macosx))`
366
266
 
367
- ### Bug fixes
368
-
369
- ### Deprecations
370
-
371
267
  ## [2.2.1] - 2018-12-08
372
- ### Enhancements
373
-
374
268
  ### Bug fixes
375
269
  - Reduce warnings for method definitions
376
270
 
377
- ### Deprecations
378
-
379
271
  ## [2.2.0] - 2018-12-01
380
272
  ### Enhancements
381
273
  - Add `::Appium::Core::Base.platform` to call `::Selenium::WebDriver::Platform`
382
274
  - Can identify platform using `::Appium::Core::Base.platform.windows?` for example
383
275
 
384
- ### Bug fixes
385
-
386
276
  ### Deprecations
387
277
  - `:offset_x` and `:offset_y` in `TouchAction#swipe` is deprecated in favor of `:end_x` and `:end_y`
388
278
 
@@ -401,10 +291,6 @@ The behaviour follows the default spec in WebDriver.
401
291
  - Update `start_recording_screen` for iOS, Appium 1.10.0
402
292
  - Add `:video_scale` and update `:video_type`
403
293
 
404
- ### Bug fixes
405
-
406
- ### Deprecations
407
-
408
294
  ## [2.1.0] - 2018-11-14
409
295
  ### Enhancements
410
296
  - Support below style _1_, has _url_ parameter, in addition to style _2_
@@ -417,27 +303,15 @@ The behaviour follows the default spec in WebDriver.
417
303
  ```
418
304
  - Add `:video_fps` param for screen recording in iOS(XCUITest) to sync with Appium 1.10.0
419
305
 
420
- ### Bug fixes
421
-
422
- ### Deprecations
423
-
424
306
  ## [2.0.6] - 2018-11-08
425
307
  ### Enhancements
426
308
  - Allow selenium update following Pi versioning like 3.141.0
427
309
  - [internal] Update dev libraries
428
310
 
429
- ### Bug fixes
430
-
431
- ### Deprecations
432
-
433
311
  ## [2.0.5] - 2018-10-30
434
312
  ### Enhancements
435
313
  - [internal] No longer send `strategy: :tapOutside` as default value in Android
436
314
 
437
- ### Bug fixes
438
-
439
- ### Deprecations
440
-
441
315
  ## [2.0.4] - 2018-10-19
442
316
  ### Enhancements
443
317
  - Add custom locator in the future work: [element-finding-plugins](https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/element-finding-plugins.md)
@@ -447,27 +321,15 @@ The behaviour follows the default spec in WebDriver.
447
321
 
448
322
  ```
449
323
 
450
- ### Bug fixes
451
-
452
- ### Deprecations
453
-
454
324
  ## [2.0.3] - 2018-10-11
455
325
  ### Enhancements
456
326
  - Set `'selenium-webdriver', '~> 3.14.1'`
457
327
 
458
- ### Bug fixes
459
-
460
- ### Deprecations
461
-
462
328
  ## [2.0.2] - 2018-10-02
463
329
  ### Enhancements
464
330
  - Add finger print feature for Android emulators [#13](https://github.com/appium/ruby_lib_core/issues/13)
465
331
  - Add `keyboard_shown?` and `context=` as aliases of `is_keyboard_shown` and `set_contex`
466
332
 
467
- ### Bug fixes
468
-
469
- ### Deprecations
470
-
471
333
  ## [2.0.1] - 2018-09-01
472
334
  ### Enhancements
473
335
  - Add `Appium::Core::Base::Driver#perform_actions` to send multiple actions. See `test_multiple_actions` as an example.
@@ -475,8 +337,6 @@ The behaviour follows the default spec in WebDriver.
475
337
  ### Bug fixes
476
338
  - Fix desired capability for W3C protocol under selenium grid environment [#137](https://github.com/appium/ruby_lib_core/issues/137)
477
339
 
478
- ### Deprecations
479
-
480
340
  ## [2.0.0] - 2018-08-25
481
341
 
482
342
  This release has a breaking change for creating core. Thus, I've bumped the major version.
@@ -484,20 +344,14 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
484
344
  ### Enhancements
485
345
  - use `autoload` to load Android/iOS modules
486
346
 
487
- ### Bug fixes
488
-
489
347
  ### Deprecations
490
348
  - `@core = Appium::Core.for(self, opts)` is deprecated in favor of `@core = Appium::Core.for(opts)`
491
349
  - Call `extend Appium::Core::Device` if you'd like to extend methods defined in `Appium::Core`
492
350
  - Read [#816](https://github.com/appium/ruby_lib/pull/816) as an example
493
351
 
494
352
  ## [1.9.2] - 2018-08-23
495
- ### Enhancements
496
-
497
353
  ### Bug fixes
498
- - fix unexpedted method missing against `:to_hash` in Element
499
-
500
- ### Deprecations
354
+ - fix unexpected method missing against `:to_hash` in Element
501
355
 
502
356
  ## [1.9.1] - 2018-08-20
503
357
  ### Enhancements
@@ -507,8 +361,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
507
361
  ### Bug fixes
508
362
  - [internal] Fix raising error in `set_implicit_wait_by_default` [#130](https://github.com/appium/ruby_lib_core/issues/130)
509
363
 
510
- ### Deprecations
511
-
512
364
  ## [1.9.0] - 2018-08-05
513
365
  ### Enhancements
514
366
  - Update documentation about `start_recording_screen`
@@ -516,8 +368,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
516
368
  - Support `find_element/s :image, partial_image` [#119](https://github.com/appium/ruby_lib_core/pull/119)
517
369
  - Requires `selenium-webdriver 3.14+` because of W3C actions [#115](https://github.com/appium/ruby_lib_core/pull/115)
518
370
 
519
- ### Bug fixes
520
-
521
371
  ### Deprecations
522
372
  - [Internal] Deprecate experimental `ImageElement` in favor of `Element`
523
373
 
@@ -527,10 +377,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
527
377
  - Use method missing to get attributes like `e.resource_id` instead of `e.attribute 'resource-id'` [#116](https://github.com/appium/ruby_lib_core/pull/116)
528
378
  - Set `'~> 3.5', '< 3.14'`
529
379
 
530
- ### Bug fixes
531
-
532
- ### Deprecations
533
-
534
380
  ## [1.8.3] - 2018-07-20
535
381
  ### Enhancements
536
382
  - Relax the logic of `:app` capability
@@ -538,11 +384,7 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
538
384
  ### Bug fixes
539
385
  - Fix `within_context`
540
386
 
541
- ### Deprecations
542
-
543
387
  ## [1.8.2] - 2018-07-17
544
- ### Enhancements
545
-
546
388
  ### Bug fixes
547
389
  - Available packages over HTTP [#106](https://github.com/appium/ruby_lib_core/issues/106)
548
390
 
@@ -550,23 +392,15 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
550
392
  - Remove warning of camelCase capability for W3C format
551
393
 
552
394
  ## [1.8.1] - 2018-07-13
553
- ### Enhancements
554
-
555
395
  ### Bug fixes
556
396
  - Fix including search context in `::Selenium::WebDriver::Elemenet`
557
397
  - `include ::Appium::Core::Base::SearchContext` instead of `::Selenium::WebDriver::SearchContext`
558
398
 
559
- ### Deprecations
560
-
561
399
  ## [1.8.0] - 2018-07-07
562
400
  ### Enhancements
563
401
  - Add Tizen case
564
402
  - [Internal] reduce method definition by `add_endpoint_method`
565
403
 
566
- ### Bug fixes
567
-
568
- ### Deprecations
569
-
570
404
  ## [1.7.2] - 2018-06-23
571
405
  ### Enhancements
572
406
  - Add `find_element_by_image` and `find_elements_by_image` to handle `ImageElement`
@@ -575,10 +409,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
575
409
  - Experimental feature
576
410
  - [Internal] Define screenshot methods in appium_lib_core instead of Selenium's one
577
411
 
578
- ### Bug fixes
579
-
580
- ### Deprecations
581
-
582
412
  ## [1.7.1] - 2018-06-15
583
413
  ### Enhancements
584
414
  - Add a `format` argument for `device_time` [#94](https://github.com/appium/ruby_lib_core/pull/94)
@@ -586,8 +416,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
586
416
  ### Bug fixes
587
417
  - Return empty array `[]` for find_elements
588
418
 
589
- ### Deprecations
590
-
591
419
  ## [1.7.0] - 2018-05-28
592
420
  ### Enhancements
593
421
  - Has one **Breaking Change**
@@ -600,10 +428,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
600
428
  - [Internal] Change directory and file structure
601
429
  - [Internal] Set default content-type
602
430
 
603
- ### Bug fixes
604
-
605
- ### Deprecations
606
-
607
431
  ## [1.6.0] - 2018-05-08
608
432
  ### Enhancements
609
433
  - **Breaking Change**
@@ -615,36 +439,22 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
615
439
  - add `battery_info` to get battery information
616
440
  - add `is_keyboard_shown` for iOS ( see also https://github.com/appium/appium-xcuitest-driver/pull/664/files )
617
441
 
618
- ### Bug fixes
619
-
620
- ### Deprecations
621
-
622
442
  ## [1.5.1] - 2018-04-25
623
- ### Enhancements
624
-
625
443
  ### Bug fixes
626
444
  - Revert timeout logic in `1.4.1`
627
445
 
628
- ### Deprecations
629
-
630
446
  ## [1.5.0] - 2018-04-25
631
447
  ### Enhancements
632
448
  - [internal] Remove hot fix for XCUITest action
633
449
 
634
- ### Bug fixes
635
-
636
450
  ### Deprecations
637
451
  - Changed the name of arguments
638
452
  - `swipe(start_x:, start_y:, end_x:, end_y:)` instead of `swipe(start_x:, start_y:, offset_x:, offset_y:)`
639
453
 
640
454
  ## [1.4.2] - 2018-04-22
641
- ### Enhancements
642
-
643
455
  ### Bug fixes
644
456
  - Revert `delegate_from_appium_driver` for `ruby_lib` compatibility
645
457
 
646
- ### Deprecations
647
-
648
458
  ## [1.4.1] - 2018-04-22
649
459
  ### Enhancements
650
460
  - add base image comparison
@@ -653,54 +463,30 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
653
463
  - Raise `::Appium::Core::Wait::TimeoutError` instead of `::Selenium::WebDriver::Error::TimeOutError`
654
464
  - [internal] Separate mjsonwp commands module and w3c commands module from one command module
655
465
 
656
- ### Bug fixes
657
-
658
- ### Deprecations
659
-
660
466
  ## [1.4.0] - 2018-04-15
661
467
  ### Enhancements
662
468
  - Add a support for WebSocket client based on Faye::WebSocket::Client [#74](https://github.com/appium/ruby_lib_core/pull/74)
663
469
 
664
- ### Bug fixes
665
-
666
- ### Deprecations
667
-
668
470
  ## [1.3.8] - 2018-04-12
669
471
  ### Enhancements
670
472
  - Make no-argument commands friendly for IDE
671
473
 
672
- ### Bug fixes
673
-
674
- ### Deprecations
675
-
676
474
  ## [1.3.7] - 2018-04-02
677
475
  ### Enhancements
678
476
  - Only for `ruby_lib_core` internal process
679
477
  - Remove `touch` action by default and following `selenium-webdriver` in W3C action.
680
478
  - Since XCUITest and UA2 drivers force handling the pointer as `touch`.
681
479
 
682
- ### Bug fixes
683
-
684
- ### Deprecations
685
-
686
480
  ## [1.3.6] - 2018-04-01
687
481
  ### Enhancements
688
482
  - Be able to change `kind` in W3C touch action.
689
483
  - Read: https://github.com/appium/ruby_lib_core/blob/master/lib/appium_lib_core/common/base/bridge/w3c.rb#L29
690
484
 
691
- ### Bug fixes
692
-
693
- ### Deprecations
694
-
695
485
  ## [1.3.5] - 2018-03-30
696
486
  ### Enhancements
697
487
  - Add a `bug_report` option in `start_recording_screen`, Android
698
488
  - Add clipboard apis [#69](https://github.com/appium/ruby_lib_core/pull/69)
699
489
 
700
- ### Bug fixes
701
-
702
- ### Deprecations
703
-
704
490
  ## [1.3.4] - 2018-03-21
705
491
  ### Enhancements
706
492
  - Add `save_viewport_screenshot` which get screenshot except for status bar.
@@ -710,16 +496,10 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
710
496
  ### Bug fixes
711
497
  - Fix _create_session attempt to throw non-existent error type Appium::Core::Error::WebDriverError_ [#66](https://github.com/appium/ruby_lib_core/issues/66)
712
498
 
713
- ### Deprecations
714
-
715
499
  ## [1.3.3] - 2018-03-03
716
500
  ### Enhancements
717
501
  - add `session_capabilities`: https://appium.io/docs/en/commands/session/get/
718
502
 
719
- ### Bug fixes
720
-
721
- ### Deprecations
722
-
723
503
  ## [1.3.2] - 2018-02-18
724
504
  ### Enhancements
725
505
  - Add Android emulator commands
@@ -727,10 +507,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
727
507
  - Add toggles
728
508
  - `toggle_location_services`, `toggle_wifi`, `toggle_data`
729
509
 
730
- ### Bug fixes
731
-
732
- ### Deprecations
733
-
734
510
  ## [1.3.1] - 2018-02-14
735
511
  ### Enhancements
736
512
  - add some app management commands [#58](https://github.com/appium/ruby_lib_core/pull/58)
@@ -752,10 +528,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
752
528
  .perform
753
529
  ```
754
530
 
755
- ### Bug fixes
756
-
757
- ### Deprecations
758
-
759
531
  ## [1.3.0] - 2018-01-28
760
532
  ### Enhancements
761
533
  - `start_recording_screen`/`stop_recording_screen` support iOS from `Appium 1.8.0` [#48](https://github.com/appium/ruby_lib_core/issues/48)
@@ -763,10 +535,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
763
535
  - `start_recording_screen`
764
536
  - The argument, `file_path`, was removed.
765
537
 
766
- ### Bug fixes
767
-
768
- ### Deprecations
769
-
770
538
  ## [1.2.7] - 2018-01-25
771
539
  ### Enhancements
772
540
  - Print warning messages to use camelCase if capability key names are snake_case
@@ -775,8 +543,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
775
543
  ### Bug fixes
776
544
  - Make `@driver.automation_name` downcase [#50](https://github.com/appium/ruby_lib_core/issues/50)
777
545
 
778
- ### Deprecations
779
-
780
546
  ## [1.2.6] - 2018-01-21
781
547
  ### Enhancements
782
548
  - Add `window_rect`
@@ -784,17 +550,11 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
784
550
  ### Bug fixes
785
551
  - Make `@driver.automation_name` symbol when someone define the `automationName` with the server argument. [#50](https://github.com/appium/ruby_lib_core/issues/50)
786
552
 
787
- ### Deprecations
788
-
789
553
  ## [1.2.5] - 2018-01-13
790
554
  ### Enhancements
791
555
  - Enhance W3C support
792
556
  - Timeout related methods
793
557
 
794
- ### Bug fixes
795
-
796
- ### Deprecations
797
-
798
558
  ## [1.2.4] - 2018-01-03
799
559
  ### Enhancements
800
560
  - Refactor `create_session` in `Appium::Core::Base::Bridge`
@@ -806,34 +566,18 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
806
566
  - Read `lib/appium_lib_core/common/base/w3c_bridge.rb` for more details
807
567
  - Can get logs like `driver.logs.available_types` and `driver.logs.get`
808
568
 
809
- ### Bug fixes
810
-
811
- ### Deprecations
812
-
813
569
  ## [1.2.3] - 2017-12-27
814
- ### Enhancements
815
-
816
570
  ### Bug fixes
817
571
  - Fix some w3c methods to work with Appium part 2 [#38](https://github.com/appium/ruby_lib_core/pull/38)
818
572
 
819
- ### Deprecations
820
-
821
573
  ## [1.2.2] - 2017-12-25
822
- ### Enhancements
823
-
824
574
  ### Bug fixes
825
575
  - Fix some w3c methods to work with Appium [#37](https://github.com/appium/ruby_lib_core/pull/37)
826
576
 
827
- ### Deprecations
828
-
829
577
  ## [1.2.1] - 2017-12-23
830
578
  ### Enhancements
831
579
  - override default duration to make some action fast [#36](https://github.com/appium/ruby_lib_core/pull/36)
832
580
 
833
- ### Bug fixes
834
-
835
- ### Deprecations
836
-
837
581
  ## [1.2.0] - 2017-12-23
838
582
  ### Enhancements
839
583
  - Append `appium:` prefix for capabilities automatically due to W3C format.
@@ -842,10 +586,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
842
586
  - IME related
843
587
  - Touch actions based on W3C spec
844
588
 
845
- ### Bug fixes
846
-
847
- ### Deprecations
848
-
849
589
  ## [1.1.0] - 2017-12-16
850
590
  ### Enhancements
851
591
  - Add guidelines in `.github`
@@ -854,8 +594,6 @@ This release has a breaking change for creating core. Thus, I've bumped the majo
854
594
  ### Bug fixes
855
595
  - fix creating sessions [#31](https://github.com/appium/ruby_lib_core/pull/31) for W3C creating sessions
856
596
 
857
- ### Deprecations
858
-
859
597
  ## [1.0.0] - 2017-11-12
860
598
 
861
599
  Initial release
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'minitest', '~> 5.0'
32
32
  spec.add_development_dependency 'minitest-reporters', '~> 1.1'
33
33
  spec.add_development_dependency 'webmock', '~> 3.11.0'
34
- spec.add_development_dependency 'rubocop', '1.7.0'
34
+ spec.add_development_dependency 'rubocop', '1.8.0'
35
35
  spec.add_development_dependency 'appium_thor', '~> 1.0'
36
36
  spec.add_development_dependency 'pry'
37
37
  spec.add_development_dependency 'pry-byebug'
@@ -290,16 +290,16 @@ module Appium
290
290
  # @driver.finger_print 1
291
291
  #
292
292
 
293
- # @!method execute_cdp(cmd, params)
293
+ # @!method execute_cdp(cmd, **params)
294
294
  # Execute Chrome Devtools protocol commands
295
295
  # https://chromedevtools.github.io/devtools-protocol
296
296
  #
297
297
  # @param [String] cmd The name of command
298
- # @param [Hash] params The parameter for the command as hash.
298
+ # @option params The parameter for the command as keyword options.
299
299
  #
300
300
  # @example
301
301
  #
302
- # @driver.execute_cdp 'Page.captureScreenshot', { quality: 50, format: 'jpeg' }
302
+ # @driver.execute_cdp 'Page.captureScreenshot', quality: 50, format: 'jpeg'
303
303
  # @driver.execute_cdp 'Page.getResourceTree'
304
304
  #
305
305
 
@@ -415,7 +415,7 @@ module Appium
415
415
  # SeleniumWebdriver could already define this method
416
416
  return if method_defined? :execute_cdp
417
417
 
418
- def execute_cdp(cmd, params = {})
418
+ def execute_cdp(cmd, **params)
419
419
  execute :chrome_send_command, {}, { cmd: cmd, params: params }
420
420
  end
421
421
  end
@@ -32,6 +32,7 @@ module Appium
32
32
  include Device::Device
33
33
  include Device::TouchActions
34
34
  include Device::ExecuteDriver
35
+ include Device::Orientation
35
36
 
36
37
  def commands(command)
37
38
  ::Appium::Core::Commands::W3C::COMMANDS[command]
@@ -15,6 +15,7 @@
15
15
  require 'base64'
16
16
  require_relative 'search_context'
17
17
  require_relative 'screenshot'
18
+ require_relative 'rotable'
18
19
 
19
20
  module Appium
20
21
  module Core
@@ -22,12 +23,12 @@ module Appium
22
23
  class Driver < ::Selenium::WebDriver::Driver
23
24
  include ::Selenium::WebDriver::DriverExtensions::UploadsFiles
24
25
  include ::Selenium::WebDriver::DriverExtensions::HasSessionId
25
- include ::Selenium::WebDriver::DriverExtensions::Rotatable
26
26
  include ::Selenium::WebDriver::DriverExtensions::HasRemoteStatus
27
27
  include ::Selenium::WebDriver::DriverExtensions::HasWebStorage
28
28
 
29
+ include ::Appium::Core::Base::Rotatable
29
30
  include ::Appium::Core::Base::SearchContext
30
- include ::Appium::Core::Base::TakeScreenshot
31
+ include ::Appium::Core::Base::TakesScreenshot
31
32
 
32
33
  # Private API.
33
34
  # Do not use this for general use. Used by flutter driver to get bridge for creating a new element
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Appium
16
+ module Core
17
+ class Base
18
+ #
19
+ # @api private
20
+ #
21
+
22
+ module Rotatable
23
+ ORIENTATIONS = %i[landscape portrait].freeze
24
+
25
+ #
26
+ # Change the screen orientation
27
+ #
28
+ # @param [:landscape, :portrait] orientation
29
+ #
30
+ #
31
+ def rotation=(orientation)
32
+ unless ORIENTATIONS.include?(orientation)
33
+ raise ArgumentError, "expected #{ORIENTATIONS.inspect}, got #{orientation.inspect}"
34
+ end
35
+
36
+ bridge.screen_orientation = orientation.to_s.upcase
37
+ end
38
+ alias rotate rotation=
39
+
40
+ #
41
+ # Get the current screen orientation
42
+ #
43
+ # @return [:landscape, :portrait] orientation
44
+ #
45
+ # @api public
46
+ #
47
+
48
+ def orientation
49
+ bridge.screen_orientation.to_sym.downcase
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -15,7 +15,7 @@
15
15
  module Appium
16
16
  module Core
17
17
  class Base
18
- module TakeScreenshot
18
+ module TakesScreenshot
19
19
  #
20
20
  # Save a PNG screenshot to the given path
21
21
  #
@@ -29,6 +29,7 @@ require_relative 'device/clipboard_content_type'
29
29
  require_relative 'device/device'
30
30
  require_relative 'device/touch_actions'
31
31
  require_relative 'device/execute_driver'
32
+ require_relative 'device/orientation'
32
33
 
33
34
  # The following files have selenium-webdriver related stuff.
34
35
  require_relative 'base/driver'
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Appium
16
+ module Core
17
+ class Base
18
+ module Device
19
+ module Orientation
20
+ def screen_orientation=(orientation)
21
+ execute :set_screen_orientation, {}, { orientation: orientation }
22
+ end
23
+
24
+ def screen_orientation
25
+ execute :get_screen_orientation
26
+ end
27
+ end # module Orientation
28
+ end # module Device
29
+ end # class Base
30
+ end # module Core
31
+ end # module Appium
@@ -21,6 +21,9 @@ module Appium
21
21
  # To extend Appium related SearchContext into ::Selenium::WebDriver::Element
22
22
  include ::Appium::Core::Base::SearchContext
23
23
 
24
+ # TODO: Probably can remove own TakesScreenshot since Selenium 4
25
+ include ::Appium::Core::Base::TakesScreenshot
26
+
24
27
  # Returns the value of attributes like below. Read each platform to know more details.
25
28
  #
26
29
  # uiautomator2: https://github.com/appium/appium-uiautomator2-server/blob/203cc7e57ce477f3cff5d95b135d1b3450a6033a/app/src/main/java/io/appium/uiautomator2/utils/Attribute.java#L19
@@ -99,6 +102,56 @@ module Appium
99
102
  w = driver.window_size
100
103
  ::Selenium::WebDriver::Point.new "#{center_x} / #{w.width.to_f}", "#{center_y} / #{w.height.to_f}"
101
104
  end
105
+
106
+ # Return an element screenshot as base64
107
+ #
108
+ # @return String Base 64 encoded string
109
+ #
110
+ # @example
111
+ #
112
+ # element.screenshot #=> "iVBORw0KGgoAAAANSUhEUgAABDgAAAB+CAIAAABOPDa6AAAAAX"
113
+ #
114
+ def screenshot
115
+ bridge.take_element_screenshot(self)
116
+ end
117
+
118
+ # Return an element screenshot in the given format
119
+ #
120
+ # @param [:base64, :png] format
121
+ # @return String screenshot
122
+ #
123
+ # @example
124
+ #
125
+ # element.screenshot_as :base64 #=> "iVBORw0KGgoAAAANSUhEUgAABDgAAAB+CAIAAABOPDa6AAAAAX"
126
+ #
127
+ def screenshot_as(format)
128
+ case format
129
+ when :base64
130
+ bridge.take_element_screenshot(self)
131
+ when :png
132
+ bridge.take_element_screenshot(self).unpack('m')[0]
133
+ else
134
+ raise Core::Error::UnsupportedOperationError, "unsupported format: #{format.inspect}"
135
+ end
136
+ end
137
+
138
+ # Save an element screenshot to the given path
139
+ #
140
+ # @param [String] png_path A path to save the screenshot
141
+ # @return [File] Path to the element screenshot.
142
+ #
143
+ # @example
144
+ #
145
+ # element.save_screenshot("fine_name.png")
146
+ #
147
+ def save_screenshot(png_path)
148
+ extension = File.extname(png_path).downcase
149
+ if extension != '.png'
150
+ ::Appium::Logger.warn 'name used for saved screenshot does not match file type. '\
151
+ 'It should end with .png extension'
152
+ end
153
+ File.open(png_path, 'wb') { |f| f << screenshot_as(:png) }
154
+ end
102
155
  end
103
156
  end # module Core
104
157
  end # module Appium
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '4.1.0' unless defined? ::Appium::Core::VERSION
18
- DATE = '2020-12-25' unless defined? ::Appium::Core::DATE
17
+ VERSION = '4.2.1' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2021-01-10' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
data/release_notes.md CHANGED
@@ -1,3 +1,24 @@
1
+ #### v4.2.1 2021-01-10
2
+
3
+ - [23e944e](https://github.com/appium/ruby_lib_core/commit/23e944ed72c6ea861532f5acc1381af4441705e6) Release 4.2.1
4
+ - [1a416b1](https://github.com/appium/ruby_lib_core/commit/1a416b136beb2b9115d3eb6637b22817f0e55601) chore: move rotable for w3c (#300)
5
+ - [95821c6](https://github.com/appium/ruby_lib_core/commit/95821c6f1a4ebc785e2dc3e6e16c1705521237e8) ci: bump android app (#299)
6
+ - [4e1770e](https://github.com/appium/ruby_lib_core/commit/4e1770e3b9d6995b1d5430b9033097609edca1c8) chore(deps-dev): update rubocop requirement from = 1.7.0 to = 1.8.0 (#298)
7
+ - [b230512](https://github.com/appium/ruby_lib_core/commit/b230512c52875ea70545d3d2262c306640f87f7d) chore: fix rubocop
8
+
9
+
10
+ #### v4.2.0 2021-01-02
11
+
12
+ - [e55b2b6](https://github.com/appium/ruby_lib_core/commit/e55b2b6f7fe293091be0d3835075e66c74f3b9dd) Release 4.2.0
13
+ - [b0cd235](https://github.com/appium/ruby_lib_core/commit/b0cd235a7fb6e5a8957871650bf86962cf0e0368) feat: append screenshot in element module as well (#297)
14
+
15
+
16
+ #### v4.1.1 2020-12-25
17
+
18
+ - [3a4cf56](https://github.com/appium/ruby_lib_core/commit/3a4cf56c73a64fb10ca0b7fecc5800719838095c) Release 4.1.1
19
+ - [6b2d7dd](https://github.com/appium/ruby_lib_core/commit/6b2d7ddf027b5a9f49cbe9a7f5622eb345e2c076) fix: keyword argument in Ruby 3
20
+
21
+
1
22
  #### v4.1.0 2020-12-25
2
23
 
3
24
  - [89110a9](https://github.com/appium/ruby_lib_core/commit/89110a995b869471a134f8c45ebe8dfbaabfba63) Release 4.1.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: 4.1.0
4
+ version: 4.2.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: 2020-12-26 00:00:00.000000000 Z
11
+ date: 2021-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -134,14 +134,14 @@ dependencies:
134
134
  requirements:
135
135
  - - '='
136
136
  - !ruby/object:Gem::Version
137
- version: 1.7.0
137
+ version: 1.8.0
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - '='
143
143
  - !ruby/object:Gem::Version
144
- version: 1.7.0
144
+ version: 1.8.0
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: appium_thor
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -268,6 +268,7 @@ files:
268
268
  - lib/appium_lib_core/common/base/driver.rb
269
269
  - lib/appium_lib_core/common/base/http_default.rb
270
270
  - lib/appium_lib_core/common/base/platform.rb
271
+ - lib/appium_lib_core/common/base/rotable.rb
271
272
  - lib/appium_lib_core/common/base/screenshot.rb
272
273
  - lib/appium_lib_core/common/base/search_context.rb
273
274
  - lib/appium_lib_core/common/command.rb
@@ -287,6 +288,7 @@ files:
287
288
  - lib/appium_lib_core/common/device/ime_actions.rb
288
289
  - lib/appium_lib_core/common/device/keyboard.rb
289
290
  - lib/appium_lib_core/common/device/keyevent.rb
291
+ - lib/appium_lib_core/common/device/orientation.rb
290
292
  - lib/appium_lib_core/common/device/screen_record.rb
291
293
  - lib/appium_lib_core/common/device/setting.rb
292
294
  - lib/appium_lib_core/common/device/touch_actions.rb