Skip to content

Commit

Permalink
feat: bump ruby lib core v8 (#1018)
Browse files Browse the repository at this point in the history
- BREAKING: Remove Appium::MultiTouch and Appium::TouchAction
  • Loading branch information
KazuCocoa authored Mar 16, 2024
1 parent 9d40e0e commit c450c20
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 478 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ Commit based release not is [release_notes.md](./release_notes.md)

Release tags are https://github.com/appium/ruby_lib/releases .

## (not released yet)
- Breaking
- Use appium_lib_core 8.0.0 and up
- Please refer to [the diff](https://github.com/appium/ruby_lib_core/blob/master/CHANGELOG.md#800---2024-03-08) about the details.
- Remove `Appium::MultiTouch` and `Appium::TouchAction`
- `swipe` could use `mobile:swipe`, or w3c actions. Multi-touch actions such as zoom/pinch can be written in w3c actions.
- Please use [w3c actions](https://github.com/appium/ruby_lib/blob/master/docs/w3c.md) instead. Several resources such as [test code in ruby_lib_core](https://github.com/appium/ruby_lib_core/blob/master/test/functional/common_w3c_actions.rb) also would help to check the syntax.

## 14.0.0 - 2024-01-25
- Use appium_lib_core 7.4.0 and up
- Removed deprecated `export_session` and `export_session_path`
- Please get the session id via `driver.session_id` intead
- Please get the session id via `driver.session_id` instead

## 13.0.2 - 2024-01-25
- Allow up to appium_lib_core 7.3
Expand Down
61 changes: 0 additions & 61 deletions android_tests/lib/android/specs/device/touch_actions.rb

This file was deleted.

2 changes: 1 addition & 1 deletion appium_lib.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.homepage = 'https://github.com/appium/ruby_lib' # published as appium_lib
s.require_paths = ['lib']

s.add_runtime_dependency 'appium_lib_core', '>= 7.4.0', '< 8'
s.add_runtime_dependency 'appium_lib_core', '~> 8.0.0'
s.add_runtime_dependency 'nokogiri', '~> 1.8', '>= 1.8.1'
s.add_runtime_dependency 'tomlrb', '>= 1.1', '< 3.0'

Expand Down
6 changes: 5 additions & 1 deletion docs/w3c.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ dialect #=> :w3c
el = find_element(:name, 'Pickers')
driver.action.click(el).perform #=> work


# Scroll/Swipe
driver.action
.move_to_location(500, 500).pointer_down(:left)
.move_to_location(0, 700)
.release.perform


# Zoom in
# multiple action chains
f1 = driver.action.add_pointer_input(:touch, 'finger1')
f1.create_pointer_move(duration: 1, x: 200, y: 500,
Expand Down Expand Up @@ -48,4 +52,4 @@ driver.perform_actions [f1, f2]
## Limitations
- WebDriverAgent support only `touch` as a `pointer type`.
- By default, [ruby_lib_core](https://github.com/appium/ruby_lib_core/blob/ab5d7c5ed31f318a9395e5aeafe1d0d655d3cff4/lib/appium_lib_core/common/base/w3c_bridge.rb#L26) generate `touch` based actions.
- About `pointer type` => [W3C](https://www.w3.org/TR/webdriver/#perform-actions) and [Simple WD Spec](https://github.com/jlipps/simple-wd-spec#perform-actions)
- About `pointer type` => [W3C](https://www.w3.org/TR/webdriver/#perform-actions) and [Simple WD Spec](https://github.com/jlipps/simple-wd-spec#perform-actions)
2 changes: 1 addition & 1 deletion ios_tests/appium.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[caps]
platformName = "ios"
platformVersion = "17.0"
platformVersion = "17.2"
deviceName ="iPhone 15"
automationName = 'XCUITest'
app = "../test_apps/UICatalog.app.zip"
Expand Down
4 changes: 0 additions & 4 deletions ios_tests/lib/ios/specs/device/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ def go_back
proc { screen }.must_raise ::Selenium::WebDriver::Error::NoSuchElementError
end

t 'reset' do
reset
end

t 'app_strings' do
app_strings.must_include 'A Short Title Is Best'
app_strings('en').must_include 'A Short Title Is Best'
Expand Down
45 changes: 0 additions & 45 deletions ios_tests/lib/ios/specs/device/multi_touch.rb

This file was deleted.

57 changes: 0 additions & 57 deletions ios_tests/lib/ios/specs/device/touch_actions.rb

This file was deleted.

7 changes: 4 additions & 3 deletions ios_tests/parallel/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def test_run

sleep 5

# TouchAction
# TODO: fixme
text_elem = @appium.text(@appium.app_strings['ButtonsExplain'])
@appium.tap x: 0, y: 0, element: text_elem
@appium.driver.action.click(text_elem).perform
@appium.back

teardown
Expand Down Expand Up @@ -92,9 +92,10 @@ def test_run

sleep 5

# TODO: fixme
# TouchAction
text_elem = text(app_strings['ButtonsExplain'])
tap x: 0, y: 0, element: text_elem
driver.action.click(text_elem).perform
back

teardown
Expand Down
2 changes: 0 additions & 2 deletions lib/appium_lib/appium.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
require_relative 'common/wait'
require_relative 'common/log'
require_relative 'common/helper'
require_relative 'common/multi_touch'
require_relative 'common/touch_actions'
require_relative 'common/http_client'
require_relative 'common/device'
require_relative 'common/command'
Expand Down
24 changes: 0 additions & 24 deletions lib/appium_lib/common/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,5 @@
module Appium
module Device
extend Forwardable

class << self
def extended(_mod)
add_touch_actions
end

private

def add_touch_actions
actions = Appium::TouchAction::COMPLEX_ACTIONS
actions.each do |method|
delegate_from_appium_driver(method, Appium::TouchAction)
end

# To keep compatibility
# pinch and zoom are defined in Appium::MultiTouch.
delegate_from_appium_driver(:pinch, Appium::MultiTouch)
delegate_from_appium_driver(:zoom, Appium::MultiTouch)
end

def delegate_from_appium_driver(method, delegation_target)
def_delegator delegation_target, method
end
end # class << self
end # module Device
end # module Appium
Loading

0 comments on commit c450c20

Please sign in to comment.