Skip to content

Commit

Permalink
Merge branch 'master' into add_rbs_support_for_driver
Browse files Browse the repository at this point in the history
  • Loading branch information
aguspe authored Jan 1, 2025
2 parents 5eb47d8 + 6e4bc8d commit a936fe9
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 47 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Read `release_notes.md` for commit level details.

### Deprecations

## [9.3.0] - 2024-12-08

### Deprecations
- Remove deprecated `Appium::Core#quit_driver`. Please use `Appium::Core::Driver.quit` instead.

# [9.2.1] - 2024-08-01

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions appium_lib_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest-reporters', '~> 1.1'
spec.add_development_dependency 'parallel_tests'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '1.66.1'
spec.add_development_dependency 'rubocop', '1.69.2'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'steep', '~> 1.7.0'
spec.add_development_dependency 'webmock', '~> 3.23.0'
spec.add_development_dependency 'webmock', '~> 3.24.0'
spec.add_development_dependency 'yard', '~> 0.9.11'
spec.metadata['rubygems_mfa_required'] = 'true'
end
3 changes: 0 additions & 3 deletions lib/appium_lib_core/common/base/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ def add_command(method:, url:, name:, &block)
raise ::Appium::Core::Error::ArgumentError, "Available method is either #{AVAILABLE_METHODS}"
end

# TODO: Remove this logger before Appium 2.0 release
::Appium::Logger.info '[Experimental] this method is experimental for Appium 2.0. This interface may change.'

@bridge.add_command method: method, url: url, name: name, &block
end

Expand Down
32 changes: 0 additions & 32 deletions lib/appium_lib_core/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ def setup_for_new_session(opts = {})

def start_driver(server_url: nil,
http_client_ops: { http_client: nil, open_timeout: 999_999, read_timeout: 999_999 })

@custom_url ||= "http://127.0.0.1:#{@port}/wd/hub"
@custom_url = server_url unless server_url.nil?

Expand Down Expand Up @@ -431,12 +430,6 @@ def start_driver(server_url: nil,
@http_client.delete_additional_header Appium::Core::Base::Http::RequestHeaders::KEYS[:idempotency]
end

# TODO: this method can be removed after releasing Appium 2.0, and after a while
# since Appium 2.0 reuqires 'automationName'. This method won't help anymore then.
# If "automationName" is set only server side, this method set "automationName" attribute into @automation_name.
# Since @automation_name is set only client side before start_driver is called.
set_automation_name_if_nil

set_implicit_wait_by_default(@default_wait)

@driver
Expand All @@ -446,7 +439,6 @@ def start_driver(server_url: nil,
# Attach to an existing session
def attach_to(session_id, url: nil, automation_name: nil, platform_name: nil,
http_client_ops: { http_client: nil, open_timeout: 999_999, read_timeout: 999_999 })

raise ::Appium::Core::Error::ArgumentError, 'The :url must not be nil' if url.nil?
raise ::Appium::Core::Error::ArgumentError, 'The :automation_name must not be nil' if automation_name.nil?
raise ::Appium::Core::Error::ArgumentError, 'The :platform_name must not be nil' if platform_name.nil?
Expand Down Expand Up @@ -500,20 +492,6 @@ def set_implicit_wait_by_default(wait)
{}
end

# [Deprecated] Quits the driver. This method is the same as @driver.quit
# @return [void]
#
# @example
#
# @core.quit_driver
#
def quit_driver
::Appium::Logger.warn('[DEPRECATION] quit_driver will be removed. Please use @driver.quit instead.')
@driver.quit
rescue # rubocop:disable Style/RescueStandardError
nil
end

# Returns the server's version info. This method calls +driver.remote_status+ internally
#
# @return [Hash]
Expand Down Expand Up @@ -696,16 +674,6 @@ def convert_downcase(value)
value.is_a?(Symbol) ? value.downcase : value.downcase.strip.intern
end

# @private
def set_automation_name_if_nil
return unless @automation_name.nil?

automation_name = if @driver.capabilities['automationName']
@driver.capabilities['automationName'].downcase.strip.intern
end
@automation_name = convert_to_symbol automation_name
end

def get_cap(name)
name_with_prefix = "#{::Appium::Core::Base::Bridge::APPIUM_PREFIX}#{name}"
@caps[convert_to_symbol name] ||
Expand Down
4 changes: 2 additions & 2 deletions lib/appium_lib_core/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

module Appium
module Core
VERSION = '9.2.1' unless defined? ::Appium::Core::VERSION
DATE = '2024-08-01' unless defined? ::Appium::Core::DATE
VERSION = '9.3.0' unless defined? ::Appium::Core::VERSION
DATE = '2024-12-08' unless defined? ::Appium::Core::DATE
end
end
17 changes: 17 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#### v9.3.0 2024-12-08

- [ca1fc7d](https://github.com/appium/ruby_lib_core/commit/ca1fc7d85bc02e877d3d6ebc54e65b3813091edf) Release 9.3.0
- [0850725](https://github.com/appium/ruby_lib_core/commit/085072581c002566c476fe5b2d5c1091478ac86b) remove a deprecation method
- [210ea05](https://github.com/appium/ruby_lib_core/commit/210ea0547ea6b5d645a0b02f7a7c6496734a1ff0) feat!: remove deprecated quit_driver (#579)
- [3c7a96a](https://github.com/appium/ruby_lib_core/commit/3c7a96a01010f0206bb694f1192d4174b7bc21b3) chore: remove some leftover todos (#580)
- [0bd0bf4](https://github.com/appium/ruby_lib_core/commit/0bd0bf49e0e2965586f1f3b462bd816b8e45da20) chore(deps-dev): update rubocop requirement from = 1.69.0 to = 1.69.1 (#578)
- [3166df8](https://github.com/appium/ruby_lib_core/commit/3166df84bf8ed6ccf151766f0ad004a767674804) chore(deps-dev): update rubocop requirement from = 1.68.0 to = 1.69.0 (#577)
- [3c85ff0](https://github.com/appium/ruby_lib_core/commit/3c85ff03b4039aadebf0ff86de2622303a574d63) chore(deps-dev): update rubocop requirement from = 1.67.0 to = 1.68.0 (#576)
- [7022542](https://github.com/appium/ruby_lib_core/commit/702254289cd32b6d5df62776568b7a6ad7d368dd) chore(deps-dev): update rubocop requirement from = 1.66.1 to = 1.67.0 (#575)
- [27a0ca0](https://github.com/appium/ruby_lib_core/commit/27a0ca0414b5f9c26ca871ad2aa55d4ad9f3022d) chore(deps-dev): update webmock requirement from ~> 3.23.0 to ~> 3.24.0 (#574)
- [960afdf](https://github.com/appium/ruby_lib_core/commit/960afdfc718a8b97a40dc41aed9b8335e344ea5d) chore(deps-dev): update rubocop requirement from = 1.66.0 to = 1.66.1 (#573)
- [b0670e2](https://github.com/appium/ruby_lib_core/commit/b0670e2a360905d5e1c364ff7a7856136871da3a) chore(deps-dev): update rubocop requirement from = 1.65.1 to = 1.66.0 (#572)
- [038ec4e](https://github.com/appium/ruby_lib_core/commit/038ec4e1a8119f60ed8f292d219c1d6d2b4b9a85) test: add webSocketUrl in test
- [cae1716](https://github.com/appium/ruby_lib_core/commit/cae1716c0b78191512021f2025bad058b61cc9f3) chore: refer to the prefix


#### v9.2.1 2024-08-01

- [41e58e5](https://github.com/appium/ruby_lib_core/commit/41e58e53641f6f72ea987b5dc6ff6efc0db7bcd7) Release 9.2.1
Expand Down
4 changes: 0 additions & 4 deletions sig/lib/appium_lib_core/driver.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ module Appium

def set_implicit_wait_by_default: (untyped wait) -> untyped

def quit_driver: () -> void

def appium_server_version: () -> Hash[String, String]

private
Expand Down Expand Up @@ -193,8 +191,6 @@ module Appium
def set_automation_name: () -> Symbol?

def convert_downcase: (Symbol value) -> Symbol

def set_automation_name_if_nil: () -> Symbol?
end
end
end
2 changes: 0 additions & 2 deletions test/functional/android/driver_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ def test_mobile_perform_action
new_element = @driver.find_element :xpath, '//*[@focused="true"]'
assert_equal 'Right is always right', new_element.text
end

# TODO: call @driver.quit after tests
end
end
# rubocop:enable Style/ClassVars
2 changes: 0 additions & 2 deletions test/functional/ios/driver_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ def test_batch_combination_ruby_script
assert_equal(rect.width, r.result[1]['width'])
assert_equal(rect.height, r.result[1]['height'])
end

# TODO: call @driver.quit after tests
end
end
# rubocop:enable Style/ClassVars

0 comments on commit a936fe9

Please sign in to comment.