appium_lib 10.4.1 → 10.5.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.
@@ -798,6 +798,48 @@ module Appium
798
798
  @driver.set_location(latitude, longitude, altitude)
799
799
  end
800
800
 
801
+ # @since Appium 1.16.0
802
+ #
803
+ # Logs a custom event. The event is available via {::Appium::Core::Events#get} or
804
+ # <code>driver.session_capabilities['events']</code> with <code>eventTimings</code> capabilities.
805
+ #
806
+ # @param [String] vendor The vendor prefix for the event
807
+ # @param [String] event The name of event
808
+ # @returns [nil]
809
+ #
810
+ # @example
811
+ #
812
+ # log_event vendor: 'appium', event: 'funEvent'
813
+ #
814
+ # log_event = { vendor: 'appium', event: 'anotherEvent' }
815
+ # log_events #=> {...., 'appium:funEvent' => [1572957315, 1572960305],
816
+ # # 'appium:anotherEvent' => 1572959315}
817
+ #
818
+ def log_event(vendor:, event:)
819
+ @driver.logs.event vendor: vendor, event: event
820
+ end
821
+
822
+ def log_event=(log_event)
823
+ raise ArgumentError('log_event should be Hash like { vendor: "appium", event: "funEvent"}') unless log_event.is_a?(Hash)
824
+
825
+ @driver.logs.event vendor: log_event[:vendor], event: log_event[:event]
826
+ end
827
+
828
+ # @since Appium 1.16.0
829
+ # Returns events with filtering with 'type'. Defaults to all available events.
830
+ #
831
+ # @param [String] type The type of events to get
832
+ # @return [Hash]
833
+ #
834
+ # @example
835
+ #
836
+ # log_events #=> {}
837
+ # log_events #=> {'commands' => [{'cmd' => 123455, ....}], 'startTime' => 1572954894127, }
838
+ #
839
+ def log_events(type = nil)
840
+ @driver.logs.events(type)
841
+ end
842
+
801
843
  # Quit the driver and Pry.
802
844
  # quit and exit are reserved by Pry.
803
845
  # @return [void]
@@ -14,6 +14,6 @@
14
14
 
15
15
  module Appium
16
16
  # Version and Date are defined on the 'Appium' module, not 'Appium::Common'
17
- VERSION = '10.4.1' unless defined? ::Appium::VERSION
18
- DATE = '2019-09-11' unless defined? ::Appium::DATE
17
+ VERSION = '10.5.0' unless defined? ::Appium::VERSION
18
+ DATE = '2019-11-09' unless defined? ::Appium::DATE
19
19
  end
@@ -1,3 +1,9 @@
1
+ #### v10.5.0 2019-11-09
2
+
3
+ - [722c3a9](https://github.com/appium/ruby_lib/commit/722c3a9aa387d3537b648a50dc24070e62fcc57a) Release 10.5.0
4
+ - [7a2197b](https://github.com/appium/ruby_lib/commit/7a2197b46f6ec15f1adc8626bbff1be74640e98e) feat: Add log event/s (#868)
5
+
6
+
1
7
  #### v10.4.1 2019-09-11
2
8
 
3
9
  - [12317e4](https://github.com/appium/ruby_lib/commit/12317e4d74b20d01813526b28e642e3522193fa3) Release 10.4.1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.4.1
4
+ version: 10.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-09-11 00:00:00.000000000 Z
12
+ date: 2019-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appium_lib_core
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '3.2'
20
+ version: '3.3'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '3.2'
27
+ version: '3.3'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: nokogiri
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -304,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
304
  - !ruby/object:Gem::Version
305
305
  version: '0'
306
306
  requirements: []
307
- rubygems_version: 3.0.1
307
+ rubygems_version: 3.0.3
308
308
  signing_key:
309
309
  specification_version: 4
310
310
  summary: Ruby library for Appium