appium_lib_core 3.2.3 → 3.3.0

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: 620f9c1100bd3c5d4740a3b0fd39e7fc4741e318ba97c9b637e14f5e9c9cf34d
4
- data.tar.gz: 3e38c30b744ee54906fa4887fdf6cbd49cd2326e9e6c55e4891c834fbf7d1955
3
+ metadata.gz: 3e0458e9ee6c35f13a6d635ef3e1fd866681c78c0d113fc16f86effcce612f6e
4
+ data.tar.gz: ed0ba7a35963aac68ee274118633149ea37102cb1581a9acc3b2acb18cc4ca10
5
5
  SHA512:
6
- metadata.gz: d8646d2aac462bd1ad46af62c1a7017b8fdf0e23b4f3d7f966113b8967217b5c6fcece219fea630b6218ca139bee039a056cdab375f3675b9a66ed982a9a8a77
7
- data.tar.gz: 61e9c47729367969d1b029fd875e5aa1e11bec27460a0c607cbbb93cf842694f6e581ec72235252013323ada858e72182d799f2726feb19251d47cc9ab620eff
6
+ metadata.gz: 730ea372f1b8f7aaba235f9fa9ff9276aaf930190a11a53c95f5c345d3b17cca4583bb02fa9c2079e02f9ebffccbf60f8fd418116f4d62014ad3d2c6513fbb9c
7
+ data.tar.gz: 63aaca4c4608dbf988037e7e452f0d6aeb85d93b61d9c0fbb0f50fa89e0c975626466ddbd36c019fa71c6fb0d04227255ae3f25bc4f611f5a2a3a745ede610f0
data/CHANGELOG.md CHANGED
@@ -10,6 +10,16 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [3.3.0] - 2019-11-08
14
+
15
+ ### Enhancements
16
+ - Add `Logs#event` to post a custom log by `@driver.logs.event vendor: 'appium', event: 'funEvent'`
17
+ - Add `Logs#events` to get events by `@driver.logs.events`. It is equal to `@driver.session_capabilities['events']`
18
+
19
+ ### Bug fixes
20
+
21
+ ### Deprecations
22
+
13
23
  ## [3.2.3] - 2019-09-30
14
24
 
15
25
  ### Enhancements
@@ -42,6 +42,19 @@ module Appium
42
42
  execute :get_all_sessions
43
43
  end
44
44
 
45
+ # For Appium
46
+ def log_event(vendor, event)
47
+ execute :post_log_event, {}, { vendor: vendor, event: event }
48
+ end
49
+
50
+ # For Appium
51
+ def log_events(type = nil)
52
+ args = {}
53
+ args['type'] = type unless type.nil?
54
+
55
+ execute :get_log_events, {}, args
56
+ end
57
+
45
58
  def take_element_screenshot(element)
46
59
  execute :take_element_screenshot, id: element.ref
47
60
  end
@@ -204,6 +204,19 @@ module Appium
204
204
  end
205
205
  end
206
206
 
207
+ # For Appium
208
+ def log_event(vendor, event)
209
+ execute :post_log_event, {}, { vendor: vendor, event: event }
210
+ end
211
+
212
+ # For Appium
213
+ def log_events(type = nil)
214
+ args = {}
215
+ args['type'] = type unless type.nil?
216
+
217
+ execute :get_log_events, {}, args
218
+ end
219
+
207
220
  def take_viewport_screenshot
208
221
  execute_script('mobile: viewportScreenshot')
209
222
  end
@@ -65,7 +65,9 @@ module Appium
65
65
  start_recording_screen: [:post, 'session/:session_id/appium/start_recording_screen'],
66
66
  compare_images: [:post, 'session/:session_id/appium/compare_images'],
67
67
  is_keyboard_shown: [:get, 'session/:session_id/appium/device/is_keyboard_shown'],
68
- execute_driver: [:post, 'session/:session_id/appium/execute_driver']
68
+ execute_driver: [:post, 'session/:session_id/appium/execute_driver'],
69
+ post_log_event: [:post, 'session/:session_id/appium/log_event'],
70
+ get_log_events: [:post, 'session/:session_id/appium/events']
69
71
  }.freeze
70
72
 
71
73
  COMMAND_ANDROID = {
@@ -24,7 +24,7 @@ module Appium
24
24
  #
25
25
  # @example
26
26
  #
27
- # @driver.logs.get "syslog" # []
27
+ # @driver.logs.get 'syslog' # []
28
28
  # @driver.logs.get :syslog # []
29
29
  #
30
30
  def get(type)
@@ -41,6 +41,49 @@ module Appium
41
41
  def available_types
42
42
  @bridge.available_log_types
43
43
  end
44
+
45
+ # @since Appium 1.16.0
46
+ #
47
+ # Logs a custom event. The event is available via {::Appium::Core::Events#get} or
48
+ # <code>@driver.session_capabilities['events']</code> with <code>eventTimings</code> capabilities.
49
+ #
50
+ # @param [String] vendor The vendor prefix for the event
51
+ # @param [String] event The name of event
52
+ # @returns [nil]
53
+ #
54
+ # @example
55
+ #
56
+ # @driver.logs.event vendor: 'appium', event: 'funEvent'
57
+ # @driver.session_capabilities['events'] #=> {...., 'appium:funEvent' => 1572957315}
58
+ #
59
+ # @driver.logs.event = { vendor: 'appium', event: 'anotherEvent' }
60
+ # @driver.logs.events #=> {...., 'appium:funEvent' => [1572957315, 1572960305],
61
+ # # 'appium:anotherEvent' => 1572959315}
62
+ #
63
+ def event(vendor:, event:)
64
+ @bridge.log_event vendor, event
65
+ end
66
+
67
+ def event=(log_event)
68
+ raise ArgumentError('log_event should be Hash like { vendor: "appium", event: "funEvent"}') unless log_event.is_a?(Hash)
69
+
70
+ event vendor: log_event[:vendor], event: log_event[:event]
71
+ end
72
+
73
+ # @since Appium 1.16.0
74
+ # Returns events with filtering with 'type'. Defaults to all available events.
75
+ #
76
+ # @param [String] type The type of events to get
77
+ # @return [Hash]
78
+ #
79
+ # @example
80
+ #
81
+ # @driver.logs.events #=> {}
82
+ # @driver.logs.events #=> {'commands' => [{'cmd' => 123455, ....}], 'startTime' => 1572954894127, }
83
+ #
84
+ def events(type = nil)
85
+ @bridge.log_events(type)
86
+ end
44
87
  end
45
88
  end # module Core
46
89
  end # module Appium
@@ -93,6 +93,7 @@ module Appium
93
93
 
94
94
  class Driver
95
95
  include Waitable
96
+
96
97
  # Selenium webdriver capabilities
97
98
  # @return [Core::Base::Capabilities]
98
99
  attr_reader :caps
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '3.2.3' unless defined? ::Appium::Core::VERSION
18
- DATE = '2019-09-30' unless defined? ::Appium::Core::DATE
17
+ VERSION = '3.3.0' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2019-11-08' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
data/release_notes.md CHANGED
@@ -1,3 +1,9 @@
1
+ #### v3.3.0 2019-11-08
2
+
3
+ - [7fb0371](https://github.com/appium/ruby_lib_core/commit/7fb03712bb9a743c41aded5348e3c15160ef25cc) Release 3.3.0
4
+ - [c232888](https://github.com/appium/ruby_lib_core/commit/c232888f1479c3d2b240bff2ca00835b238a5cb2) feat: add posting log event/getting events (#242)
5
+
6
+
1
7
  #### v3.2.3 2019-09-30
2
8
 
3
9
  - [9af149b](https://github.com/appium/ruby_lib_core/commit/9af149bd3b086e7cb8ac07470c5d097e46ac0b65) Release 3.2.3
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: 3.2.3
4
+ version: 3.3.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: 2019-09-29 00:00:00.000000000 Z
11
+ date: 2019-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -335,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
335
335
  - !ruby/object:Gem::Version
336
336
  version: '0'
337
337
  requirements: []
338
- rubygems_version: 3.0.1
338
+ rubygems_version: 3.0.3
339
339
  signing_key:
340
340
  specification_version: 4
341
341
  summary: Minimal Ruby library for Appium.