appium_lib_core 4.6.0 → 4.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 199c9c0821774e61120fd7f1311548d9cc0fd1521d71e3b6c207fece055d11b7
4
- data.tar.gz: f7c96d05702e81bfee428012ece7f6cd05f6e475100fc3c3e00b51a4fbd7d732
3
+ metadata.gz: cd9841189c6fd82a969e7e71fb682ab89952888f2c1f86ade149a891e086d86b
4
+ data.tar.gz: c141b11f623b538908954d40b7e6d29f3950c283e39a19abd4b97c492a16d6b1
5
5
  SHA512:
6
- metadata.gz: 792aaeb715d990eb9dc7a086cc59f8ec81c06c545d4b7203a557cf60c673cade059a391d0c06b490a43834d806735c4713ae1108668271cc4da6614a48dd7c44
7
- data.tar.gz: ba0141ca83ea0c3e6839647b117c0cb518d5333d47f70d45a36a677aab98844903c3ff0331c3788451154d9937b95647c3bc9a87b5990baaab1d6ebb2615da88
6
+ metadata.gz: 9c6c662fff6e5a7209cfa7a049754414efb024df990fd537f6863fc87757221d9d6277473d8272f1ea45e6e858da4a8424aa1aed4a08ceddb0191076b6783dd5
7
+ data.tar.gz: b4ae83319f0aa62be5de53bda6b2a9374bb4a13a17fa432ee816cb388e1a6ec79b3122011ae28b1b240a09563fec903dba6e868e407a88fa8326c5e08af8a923
data/CHANGELOG.md CHANGED
@@ -10,6 +10,11 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [4.7.0] - 2021-07-17
14
+
15
+ ### Enhancements
16
+ - Add `satellites` option in `Appium::Core::Base::Driver#set_location`
17
+
13
18
  ## [4.6.0] - 2021-06-03
14
19
 
15
20
  ### Enhancements
@@ -18,7 +23,7 @@ Read `release_notes.md` for commit level details.
18
23
  ## [4.5.0] - 2021-03-14
19
24
 
20
25
  ### Enhancements
21
- - Add `speed` argument for `Appium::Core::Base::Driver#set_location` since Appium 1.21.0
26
+ - Add `speed` argument for `Appium::Core::Base::Driver#set_location` since Appium 1.21.0
22
27
  - Add `multiple` and `match_neighbour_threshold` arguments for `Appium::Core::Base::Driver#find_image_occurrence`
23
28
 
24
29
  ## [4.4.1(4.4.0)] - 2021-02-15(2021-02-13)
data/Rakefile CHANGED
@@ -38,6 +38,7 @@ namespace :test do
38
38
  namespace :unit do
39
39
  desc('Run all iOS related unit tests in test directory')
40
40
  Rake::TestTask.new(:ios) do |t|
41
+ ENV['UNIT_TEST'] = '1'
41
42
  t.libs << 'test'
42
43
  t.libs << 'lib'
43
44
  t.test_files = FileList['test/unit/ios/**/*_test.rb']
@@ -45,6 +46,7 @@ namespace :test do
45
46
 
46
47
  desc('Run all Android related unit tests in test directory')
47
48
  Rake::TestTask.new(:android) do |t|
49
+ ENV['UNIT_TEST'] = '1'
48
50
  t.libs << 'test'
49
51
  t.libs << 'lib'
50
52
  t.test_files = FileList['test/unit/android/**/*_test.rb']
@@ -52,6 +54,7 @@ namespace :test do
52
54
 
53
55
  desc('Run all common related unit tests in test directory')
54
56
  Rake::TestTask.new(:common) do |t|
57
+ ENV['UNIT_TEST'] = '1'
55
58
  t.libs << 'test'
56
59
  t.libs << 'lib'
57
60
  t.test_files = FileList['test/unit/common/**/*_test.rb']
@@ -59,6 +62,7 @@ namespace :test do
59
62
 
60
63
  desc('Run all Windows related unit tests in test directory')
61
64
  Rake::TestTask.new(:windows) do |t|
65
+ ENV['UNIT_TEST'] = '1'
62
66
  t.libs << 'test'
63
67
  t.libs << 'lib'
64
68
  t.test_files = FileList['test/unit/windows/**/*_test.rb']
@@ -95,9 +95,10 @@ module Appium
95
95
  ::Selenium::WebDriver::Element.new self, element_id_from(id)
96
96
  end
97
97
 
98
- def set_location(lat, lon, alt = 0.0, speed: nil)
98
+ def set_location(lat, lon, alt = 0.0, speed: nil, satellites: nil)
99
99
  loc = { latitude: lat, longitude: lon, altitude: alt }
100
100
  loc[:speed] = speed unless speed.nil?
101
+ loc[:satellites] = satellites unless satellites.nil?
101
102
  execute :set_location, {}, { location: loc }
102
103
  end
103
104
  end # class MJSONWP
@@ -186,9 +186,10 @@ module Appium
186
186
 
187
187
  # For Appium
188
188
  # No implementation for W3C webdriver module
189
- def set_location(lat, lon, alt = 0.0, speed: nil)
189
+ def set_location(lat, lon, alt = 0.0, speed: nil, satellites: nil)
190
190
  loc = { latitude: lat, longitude: lon, altitude: alt }
191
191
  loc[:speed] = speed unless speed.nil?
192
+ loc[:satellites] = satellites unless satellites.nil?
192
193
  execute :set_location, {}, { location: loc }
193
194
  end
194
195
 
@@ -76,7 +76,7 @@ module Appium
76
76
  path: path)
77
77
  end
78
78
 
79
- AVAILABLE_METHOD = [
79
+ AVAILABLE_METHODS = [
80
80
  :get, :head, :post, :put, :delete,
81
81
  :connect, :options, :trace, :patch
82
82
  ].freeze
@@ -90,7 +90,16 @@ module Appium
90
90
  # Other place holders can be specified with +:+ prefix like +:id+.
91
91
  # Then, the +:id+ will be replaced with a given value as the seconds argument of +execute+
92
92
  # @param [Symbol] name The name of method that is called as the driver instance method.
93
- # @param [Proc] block The block to involve as the method
93
+ # @param [Proc] block The block to involve as the method.
94
+ # Please define a method that has the same +name+ with arguments you want.
95
+ # The method must has +execute+ method. tHe +execute+ is calls the +url+
96
+ # with the given parameters.
97
+ # The first argument should be +name+ as symbol.
98
+ # The second argument should be hash. If keys in the hash matches +:+ prefix
99
+ # string in the given url, the matched string in the given url will be
100
+ # values in the hash.
101
+ # The third argument should be hash. The hash will be the request body.
102
+ # Please read examples below for more details.
94
103
  # @raise [ArgumentError] If the given +name+ is already defined or +method+ are invalid value.
95
104
  #
96
105
  # @example
@@ -118,6 +127,7 @@ module Appium
118
127
  # # ':session_id' in the given 'url' is replaced with current 'session id'.
119
128
  # @driver.test_command(1)
120
129
  #
130
+ #
121
131
  # @driver.add_command(
122
132
  # method: :post,
123
133
  # url: 'session/:session_id/element/:id/custom/action',
@@ -135,8 +145,8 @@ module Appium
135
145
  # @driver.test_action_command(e.ref, 'action')
136
146
  #
137
147
  def add_command(method:, url:, name:, &block)
138
- unless AVAILABLE_METHOD.include? method
139
- raise ::Appium::Core::Error::ArgumentError, "Available method is either #{AVAILABLE_METHOD}"
148
+ unless AVAILABLE_METHODS.include? method
149
+ raise ::Appium::Core::Error::ArgumentError, "Available method is either #{AVAILABLE_METHODS}"
140
150
  end
141
151
 
142
152
  # TODO: Remove this logger
@@ -52,19 +52,26 @@ module Appium
52
52
  # @param [String, Number] latitude Set the latitude.
53
53
  # @param [String, Number] longitude Set the longitude.
54
54
  # @param [String, Number] altitude Set the altitude.
55
- # @param [String, Number] speed Set the speed to apply the location on Android real devices @since Appium 1.21.0.
55
+ # @param [String, Number] speed Set the speed to apply the location on Android real devices
56
+ # in meters/second @since Appium 1.21.0 and in knots for emulators @since Appium 1.22.0.
57
+ # @param [String, Number] satellites Sets the number of geo satellites being tracked @since Appium 1.22.0.
58
+ # This number is respected on Emulators.
56
59
  # @param [::Selenium::WebDriver::Location]
57
60
  #
58
61
  # @example
59
62
  #
60
63
  # driver.location = ::Selenium::WebDriver::Location.new(10, 10, 10)
61
64
  #
62
- def set_location(latitude, longitude, altitude, speed: nil)
63
- if speed.nil?
65
+ def set_location(latitude, longitude, altitude, speed: nil, satellites: nil)
66
+ if speed.nil? && satellites.nil?
64
67
  self.location = ::Selenium::WebDriver::Location.new(Float(latitude), Float(longitude), Float(altitude))
65
68
  else
66
69
  loc = ::Selenium::WebDriver::Location.new(Float(latitude), Float(longitude), Float(altitude))
67
- @bridge.set_location loc.latitude, loc.longitude, loc.altitude, speed: Float(speed)
70
+
71
+ speed = Float(speed) unless speed.nil?
72
+ satellites = Integer(satellites) unless satellites.nil?
73
+
74
+ @bridge.set_location loc.latitude, loc.longitude, loc.altitude, speed: speed, satellites: satellites
68
75
  end
69
76
  end
70
77
  end
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '4.6.0' unless defined? ::Appium::Core::VERSION
18
- DATE = '2021-06-03' unless defined? ::Appium::Core::DATE
17
+ VERSION = '4.7.0' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2021-07-17' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
data/release_notes.md CHANGED
@@ -1,3 +1,12 @@
1
+ #### v4.7.0 2021-07-17
2
+
3
+ - [0059974](https://github.com/appium/ruby_lib_core/commit/0059974b0b1d79a822db84d8b0169e8393e00ef9) Release 4.7.0
4
+ - [0f93a52](https://github.com/appium/ruby_lib_core/commit/0f93a52bbdc44bf916c9b974fe9fd09d48e5ff39) test: add more example and test (#328)
5
+ - [9e37b3b](https://github.com/appium/ruby_lib_core/commit/9e37b3bc15f72f7c0117a49945a3fe482598f374) feat: add satellites for Android emulators (#327)
6
+ - [3063a73](https://github.com/appium/ruby_lib_core/commit/3063a73fa291dc378daa53b7df2e4b0b8a6f03d2) ci: calls quit_driver to ensure close the previous session
7
+ - [43fb9e7](https://github.com/appium/ruby_lib_core/commit/43fb9e77f5492a92f4f8c5a5bda71be9c3a9e2c8) chore: tweak naming in an internal variable
8
+
9
+
1
10
  #### v4.6.0 2021-06-03
2
11
 
3
12
  - [0dacfab](https://github.com/appium/ruby_lib_core/commit/0dacfab1256e1447e1f7a5974dfcf48ee0a72b9d) Release 4.6.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.6.0
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-04 00:00:00.000000000 Z
11
+ date: 2021-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -334,7 +334,7 @@ homepage: https://github.com/appium/ruby_lib_core/
334
334
  licenses:
335
335
  - Apache-2.0
336
336
  metadata: {}
337
- post_install_message:
337
+ post_install_message:
338
338
  rdoc_options: []
339
339
  require_paths:
340
340
  - lib
@@ -349,8 +349,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
349
349
  - !ruby/object:Gem::Version
350
350
  version: '0'
351
351
  requirements: []
352
- rubygems_version: 3.1.2
353
- signing_key:
352
+ rubygems_version: 3.2.15
353
+ signing_key:
354
354
  specification_version: 4
355
355
  summary: Minimal Ruby library for Appium.
356
356
  test_files: []