Skip to content

Commit

Permalink
Merge branch 'master' into test-app-with-xcode15
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Nov 19, 2023
2 parents dc8746d + 1a37ea6 commit fecfe32
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 874 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ Read `release_notes.md` for commit level details.

### Deprecations

## [7.3.2] - 2023-11-08

### Bug fixes
- Fix default value fo set context

## [7.3.1] - 2023-11-04
### Enhancements
- Bump `selenium-webdriver` max

## [7.3.0] - 2023-10-17

Expand Down
23 changes: 1 addition & 22 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,7 @@ end

desc('Execute RuboCop static code analysis')
RuboCop::RakeTask.new(:rubocop) do |t|
t.patterns = %w(lib test script)
t.patterns = %w(lib test)
t.options = %w(-D)
t.fail_on_error = true
end

desc('print commands which Ruby client has not implemented them yet')
namespace :commands do
require './script/commands'

desc('Mobile JSON protocol')
task :mjsonwp do |_t, _args|
c = Script::CommandsChecker.new
c.get_mjsonwp_routes
c.get_all_command_path './mjsonwp_routes.js'
c.all_diff_commands_mjsonwp.each { |key, value| puts("command: #{key}, method: #{value}") }
end

desc('W3C protocol')
task :w3c do |_t, _args|
c = Script::CommandsChecker.new
c.get_mjsonwp_routes
c.get_all_command_path './mjsonwp_routes.js'
c.all_diff_commands_w3c.each { |key, value| puts("command: #{key}, method: #{value}") }
end
end
2 changes: 1 addition & 1 deletion lib/appium_lib_core/common/base/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def available_contexts
# @driver.set_context "NATIVE_APP"
# @driver.context = "NATIVE_APP"
#
def context=(context = null)
def context=(context = nil)
@bridge.set_context(context)
end
alias set_context context=
Expand Down
2 changes: 1 addition & 1 deletion lib/appium_lib_core/common/device/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def available_contexts
execute(:available_contexts, {}) || []
end

def set_context(context = null)
def set_context(context = nil)
execute :set_context, {}, name: context
end
end # module ImeActions
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 = '7.3.0' unless defined? ::Appium::Core::VERSION
DATE = '2023-10-17' unless defined? ::Appium::Core::DATE
VERSION = '7.3.2' unless defined? ::Appium::Core::VERSION
DATE = '2023-11-08' unless defined? ::Appium::Core::DATE
end
end
15 changes: 15 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
#### v7.3.2 2023-11-08

- [12d6054](https://github.com/appium/ruby_lib_core/commit/12d60545aad11b7259c440c5a3beb426dd978ae8) Release 7.3.2
- [1cbafc1](https://github.com/appium/ruby_lib_core/commit/1cbafc168725b906839cc4a6391893dbb50e4091) test: tweak tests (#508)
- [163b360](https://github.com/appium/ruby_lib_core/commit/163b360a7f6cbc5ef4c5ff0b4e1caa68372174f9) chore: remove outdated files/commands
- [9651c9d](https://github.com/appium/ruby_lib_core/commit/9651c9d98819c6fc4a4bffcb0a4e6ac770322dc9) chore: removea unused line


#### v7.3.1 2023-11-04

- [42205db](https://github.com/appium/ruby_lib_core/commit/42205db807ef33da7c29bb983bc365c98d948533) Release 7.3.1
- [524424b](https://github.com/appium/ruby_lib_core/commit/524424b306de55568fce154b2ba33615ac21302b) chore(deps-dev): update rubocop requirement from = 1.57.1 to = 1.57.2 (#506)
- [7777164](https://github.com/appium/ruby_lib_core/commit/777716440bb6383bef21e9423a98c51edc4c63bb) chore(deps): update selenium-webdriver requirement from ~> 4.2, < 4.15 to ~> 4.2, < 4.16 (#507)


#### v7.3.0 2023-10-17

- [855af15](https://github.com/appium/ruby_lib_core/commit/855af15200a81fb591e7f960a479a87ad0ef4a76) Release 7.3.0
Expand Down
166 changes: 0 additions & 166 deletions script/commands.rb

This file was deleted.

57 changes: 0 additions & 57 deletions test/functional/android/android/device_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,6 @@ def test_shake
assert @driver.shake
end

def test_close_and_launch_app
if @@core.automation_name == :espresso
assert_raises ::Selenium::WebDriver::Error::UnsupportedOperationError do
@driver.close_app
end
else
@driver.close_app
assert(@driver.wait_until { |d| d.app_state('io.appium.android.apis') != :running_in_foreground })
end

if @@core.automation_name == :espresso
assert_raises ::Selenium::WebDriver::Error::UnsupportedOperationError do
@driver.launch_app
end
else
@driver.launch_app
e = @driver.wait_until { |d| d.find_element :accessibility_id, 'App' }
assert_equal 'App', e.text
end
end

def test_lock_unlock
@driver.lock
assert @driver.device_locked?
Expand Down Expand Up @@ -202,42 +181,6 @@ def test_touch_actions
@driver.back
end

# @deprecated Appium::Core::TouchAction
def test_swipe
@driver.wait_until { |d| d.find_element :accessibility_id, 'App' }.click

el = @driver.wait_until { |d| d.find_element :accessibility_id, 'Fragment' }
rect = el.rect

Appium::Core::TouchAction.new(@driver)
.swipe(start_x: 75, start_y: 500, end_x: 75, end_y: 500, duration: 500)
.perform
@driver.back # The above command become "tap" action since it doesn't move.
el = @driver.wait_until { |d| d.find_element :accessibility_id, 'Fragment' }
assert rect.x == el.rect.x
assert rect.y == el.rect.y

touch_action = Appium::Core::TouchAction.new(@driver)
.swipe(start_x: 75, start_y: 500, end_x: 75, end_y: 300, duration: 500)

assert_equal :press, touch_action.actions[0][:action]
assert_equal({ x: 75, y: 500 }, touch_action.actions[0][:options])

assert_equal :wait, touch_action.actions[1][:action]
assert_equal({ ms: 500 }, touch_action.actions[1][:options])

assert_equal :moveTo, touch_action.actions[2][:action]
assert_equal({ x: 75, y: 300 }, touch_action.actions[2][:options])

assert_equal :release, touch_action.actions[3][:action]

touch_action.perform
assert_equal [], touch_action.actions

assert rect.x == el.rect.x
assert rect.y > el.rect.y
end

def test_hidekeyboard
@driver.wait_until { |d| d.find_element :accessibility_id, 'App' }.click
@driver.wait_until { |d| d.find_element :accessibility_id, 'Activity' }.click
Expand Down
3 changes: 1 addition & 2 deletions test/functional/ios/driver_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def test_click_back
def test_default_keyboard_pref
skip_as_appium_version '1.15.0'

bundle_id = @@driver.session_capabilities['CFBundleIdentifier']
begin
@@driver.terminate_app('com.apple.Preferences') # To ensure the app shows the top view
@@driver.activate_app('com.apple.Preferences')
Expand All @@ -128,7 +127,7 @@ def test_default_keyboard_pref
assert_equal '0', auto_correction.value
assert_equal '0', predictive.value
ensure
@@driver.activate_app(bundle_id)
@@driver.activate_app('com.example.apple-samplecode.UICatalog')
end
end

Expand Down
Loading

0 comments on commit fecfe32

Please sign in to comment.