appium_lib_core 1.3.4 → 1.3.5

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: aaa0d993203afcfa428e6e478416365588854f88
4
- data.tar.gz: f087a75d818f5b888d09d606d1f60660caee5ca4
3
+ metadata.gz: b31ad437c19f4d1e46c7b4eeea5b1a3e673b7848
4
+ data.tar.gz: 06b07c12e1c7e23beacd7a8527516dfa3b798d47
5
5
  SHA512:
6
- metadata.gz: 59d58196a9e24a24d51636f1c744ca75317b9101971602efc8f5a5d21dcd9111d5f20a85da93e9c04c0edb514217888b532709a0445e7fb5e6d1e2313626c892
7
- data.tar.gz: 5f3d0e30943a11ea5df3258a8b68680f9571717c89f9d595a6ea82bd4b2555057112afaf372ff81785892558c7b29373c501049b5564600b4b55bd4af1991004
6
+ metadata.gz: 98002924f583609a1f9c5ea6b5e886b4d8e08d58a882c82ddbbbdc370736f1f0e0d11fe3155260f4cd29051fd7efabf4c47cfed32feb6faa63d1a955c213e048
7
+ data.tar.gz: e2b316d400db5ac4b3e0169798cd18408a87cf51ac0793a52f127b3f6cc2a4589c8a832600598621083132bbd6e29921d15b210ac60541006cf0fe33870e0b2e
@@ -8,6 +8,15 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  ### Deprecations
10
10
 
11
+ ## [1.3.5] - 2018-03-30
12
+ ### Enhancements
13
+ - Add a `bug_report` option in `start_recording_screen`, Android
14
+ - Add clipboard apis [#69](https://github.com/appium/ruby_lib_core/pull/69)
15
+
16
+ ### Bug fixes
17
+
18
+ ### Deprecations
19
+
11
20
  ## [1.3.4] - 2018-03-21
12
21
  ### Enhancements
13
22
  - Add `save_viewport_screenshot` which get screenshot except for status bar.
@@ -10,6 +10,7 @@ require_relative 'appium_lib_core/device/touch_actions'
10
10
  require_relative 'appium_lib_core/device/multi_touch'
11
11
  require_relative 'appium_lib_core/device/screen_record'
12
12
  require_relative 'appium_lib_core/device/app_state'
13
+ require_relative 'appium_lib_core/device/clipboard_content_type'
13
14
 
14
15
  require_relative 'appium_lib_core/android'
15
16
  require_relative 'appium_lib_core/android_uiautomator2'
@@ -1,4 +1,5 @@
1
1
  require_relative 'device/emulator'
2
+ require 'base64'
2
3
 
3
4
  module Appium
4
5
  module Android
@@ -105,7 +106,11 @@ module Appium
105
106
  # use a size supported by your device's Advanced Video Coding (AVC) encoder.
106
107
  # For example, "1280x720"
107
108
  # @param [String] time_limit: Recording time. 180 seconds is by default.
108
- # @param [String] bit_rate: The video bit rate for the video, in megabits per second. 4 Mbps(4000000) is by default.
109
+ # @param [String] bit_rate: The video bit rate for the video, in megabits per second.
110
+ # 4 Mbp/s(4000000) is by default for Android API level below 27. 20 Mb/s(20000000) for API level 27 and above.
111
+ # @param [Boolean] bug_report: Set it to `true` in order to display additional information on the video overlay,
112
+ # such as a timestamp, that is helpful in videos captured to illustrate bugs.
113
+ # This option is only supported since API level 27 (Android P).
109
114
  #
110
115
  # @example
111
116
  #
@@ -113,6 +118,27 @@ module Appium
113
118
  # @driver.start_recording_screen video_size: '1280x720', time_limit: '180', bit_rate: '5000000'
114
119
  #
115
120
 
121
+ # @!method get_clipboard(content_type: :plaintext)
122
+ # Set the content of device's clipboard.
123
+ # @param [String] content_type: one of supported content types.
124
+ # @return [String]
125
+ #
126
+ # @example
127
+ #
128
+ # @driver.get_clipboard #=> "happy testing"
129
+ #
130
+
131
+ # @!method set_clipboard(content:, content_type: :plaintext, label: nil)
132
+ # Set the content of device's clipboard.
133
+ # @param [String] label: clipboard data label.
134
+ # @param [String] content_type: one of supported content types.
135
+ # @param [String] content: Contents to be set. (Will encode with base64-encoded inside this method)
136
+ #
137
+ # @example
138
+ #
139
+ # @driver.set_clipboard(content: 'happy testing') #=> {"protocol"=>"W3C"}
140
+ #
141
+
116
142
  ####
117
143
  ## class << self
118
144
  ####
@@ -177,6 +203,7 @@ module Appium
177
203
  end
178
204
 
179
205
  add_screen_recording
206
+ add_clipboard
180
207
  Emulator.emulator_commands
181
208
  end
182
209
 
@@ -186,20 +213,56 @@ module Appium
186
213
  Appium::Core::Device.add_endpoint_method(:start_recording_screen) do
187
214
  # rubocop:disable Metrics/ParameterLists
188
215
  def start_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT', force_restart: nil,
189
- video_size: nil, time_limit: '180', bit_rate: '4000000')
216
+ video_size: nil, time_limit: '180', bit_rate: nil, bug_report: nil)
190
217
  option = ::Appium::Core::Device::ScreenRecord.new(
191
218
  remote_path: remote_path, user: user, pass: pass, method: method, force_restart: force_restart
192
219
  ).upload_option
193
220
 
194
221
  option[:videoSize] = video_size unless video_size.nil?
195
222
  option[:timeLimit] = time_limit
196
- option[:bitRate] = bit_rate
223
+ option[:bitRate] = bit_rate unless bit_rate.nil?
224
+
225
+ unless bug_report.nil?
226
+ raise 'bug_report should be true or false' unless [true, false].member?(bug_report)
227
+ option[:bugReport] = bug_report
228
+ end
197
229
 
198
230
  execute(:start_recording_screen, {}, { options: option })
199
231
  end
200
232
  # rubocop:enable Metrics/ParameterLists
201
233
  end
202
234
  end
235
+
236
+ def add_clipboard
237
+ ::Appium::Core::Device.add_endpoint_method(:get_clipboard) do
238
+ def get_clipboard(content_type: :plaintext)
239
+ unless ::Appium::Core::Device::Clipboard::CONTENT_TYPE.member?(content_type)
240
+ raise "content_type should be #{::Appium::Core::Device::Clipboard::CONTENT_TYPE}"
241
+ end
242
+
243
+ params = { contentType: content_type }
244
+
245
+ data = execute(:get_clipboard, {}, params)
246
+ Base64.decode64 data
247
+ end
248
+ end
249
+
250
+ ::Appium::Core::Device.add_endpoint_method(:set_clipboard) do
251
+ def set_clipboard(content:, content_type: :plaintext, label: nil)
252
+ unless ::Appium::Core::Device::Clipboard::CONTENT_TYPE.member?(content_type)
253
+ raise "content_type should be #{::Appium::Core::Device::Clipboard::CONTENT_TYPE}"
254
+ end
255
+
256
+ params = {
257
+ contentType: content_type,
258
+ content: Base64.encode64(content)
259
+ }
260
+ params[:label] = label unless label.nil?
261
+
262
+ execute(:set_clipboard, {}, params)
263
+ end
264
+ end
265
+ end
203
266
  end
204
267
  end # module Device
205
268
  end # module Android
@@ -56,6 +56,8 @@ module Appium
56
56
  push_file: [:post, 'session/:session_id/appium/device/push_file'.freeze],
57
57
  pull_file: [:post, 'session/:session_id/appium/device/pull_file'.freeze],
58
58
  pull_folder: [:post, 'session/:session_id/appium/device/pull_folder'.freeze],
59
+ get_clipboard: [:post, 'session/:session_id/appium/device/get_clipboard'.freeze],
60
+ set_clipboard: [:post, 'session/:session_id/appium/device/set_clipboard'.freeze],
59
61
  get_settings: [:get, 'session/:session_id/appium/settings'.freeze],
60
62
  update_settings: [:post, 'session/:session_id/appium/settings'.freeze],
61
63
  touch_actions: [:post, 'session/:session_id/touch/perform'.freeze],
@@ -0,0 +1,9 @@
1
+ module Appium
2
+ module Core
3
+ module Device
4
+ module Clipboard
5
+ CONTENT_TYPE = [:plaintext, :image, :url].freeze
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,5 @@
1
+ require 'base64'
2
+
1
3
  module Appium
2
4
  module Ios
3
5
  module Device
@@ -28,6 +30,26 @@ module Appium
28
30
  # @driver.toggle_touch_id_enrollment false #=> Disable toggle enrolled
29
31
  #
30
32
 
33
+ # @!method get_clipboard(content_type: :plaintext)
34
+ # Set the content of device's clipboard.
35
+ # @param [String] content_type: one of supported content types.
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ #
40
+ # @driver.get_clipboard #=> "happy testing"
41
+ #
42
+
43
+ # @!method set_clipboard(content:, content_type: :plaintext)
44
+ # Set the content of device's clipboard.
45
+ # @param [String] content_type: one of supported content types.
46
+ # @param [String] content: Contents to be set. (Will encode with base64-encoded inside this method)
47
+ #
48
+ # @example
49
+ #
50
+ # @driver.set_clipboard(content: 'happy testing') #=> {"protocol"=>"W3C"}
51
+ #
52
+
31
53
  ####
32
54
  ## class << self
33
55
  ####
@@ -47,6 +69,41 @@ module Appium
47
69
  execute :toggle_touch_id_enrollment, {}, enabled: enabled
48
70
  end
49
71
  end
72
+
73
+ add_clipboard
74
+ end
75
+
76
+ private
77
+
78
+ def add_clipboard
79
+ ::Appium::Core::Device.add_endpoint_method(:get_clipboard) do
80
+ def get_clipboard(content_type: :plaintext)
81
+ unless ::Appium::Core::Device::Clipboard::CONTENT_TYPE.member?(content_type)
82
+ raise "content_type should be #{::Appium::Core::Device::Clipboard::CONTENT_TYPE}"
83
+ end
84
+
85
+ params = {}
86
+ params[:contentType] = content_type
87
+
88
+ data = execute(:get_clipboard, {}, params)
89
+ Base64.decode64 data
90
+ end
91
+ end
92
+
93
+ ::Appium::Core::Device.add_endpoint_method(:set_clipboard) do
94
+ def set_clipboard(content:, content_type: :plaintext)
95
+ unless ::Appium::Core::Device::Clipboard::CONTENT_TYPE.member?(content_type)
96
+ raise "content_type should be #{::Appium::Core::Device::Clipboard::CONTENT_TYPE}"
97
+ end
98
+
99
+ params = {
100
+ contentType: content_type,
101
+ content: Base64.encode64(content)
102
+ }
103
+
104
+ execute(:set_clipboard, {}, params)
105
+ end
106
+ end
50
107
  end
51
108
  end
52
109
  end # module Device
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Core
3
- VERSION = '1.3.4'.freeze unless defined? ::Appium::Core::VERSION
4
- DATE = '2018-03-21'.freeze unless defined? ::Appium::Core::DATE
3
+ VERSION = '1.3.5'.freeze unless defined? ::Appium::Core::VERSION
4
+ DATE = '2018-03-30'.freeze unless defined? ::Appium::Core::DATE
5
5
  end
6
6
  end
@@ -1,3 +1,10 @@
1
+ #### v1.3.5 2018-03-30
2
+
3
+ - [1f10dcb](https://github.com/appium/ruby_lib_core/commit/1f10dcb1448d44fd336317a7d16dd53ee03355f8) Release 1.3.5
4
+ - [993840a](https://github.com/appium/ruby_lib_core/commit/993840a698fe302434ef895213998f6b55d0497c) add clipboard api (#69)
5
+ - [8ce848c](https://github.com/appium/ruby_lib_core/commit/8ce848c848e3e312fd8af3c4a2733fdc9fc093bc) Add bug report option (#68)
6
+
7
+
1
8
  #### v1.3.4 2018-03-21
2
9
 
3
10
  - [053458e](https://github.com/appium/ruby_lib_core/commit/053458e8c766c2f83c7025251e1aeebb1a2da4d5) Release 1.3.4
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: 1.3.4
4
+ version: 1.3.5
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-03-21 00:00:00.000000000 Z
11
+ date: 2018-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -233,6 +233,7 @@ files:
233
233
  - lib/appium_lib_core/common/log.rb
234
234
  - lib/appium_lib_core/common/logger.rb
235
235
  - lib/appium_lib_core/device/app_state.rb
236
+ - lib/appium_lib_core/device/clipboard_content_type.rb
236
237
  - lib/appium_lib_core/device/multi_touch.rb
237
238
  - lib/appium_lib_core/device/screen_record.rb
238
239
  - lib/appium_lib_core/device/touch_actions.rb