Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.

## [Unreleased]
### Enhancements
- override default duration to make some action fast [#36](https://github.com/appium/ruby_lib_core/pull/36)

### Bug fixes

Expand Down
4 changes: 4 additions & 0 deletions lib/appium_lib_core/common/base/w3c_bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ module Appium
module Core
class Base
class CoreBridgeW3C < ::Selenium::WebDriver::Remote::W3C::Bridge
# Used for default duration of each touch actions
# Override from 250 milliseconds to 50 milliseconds
::Selenium::WebDriver::PointerActions::DEFAULT_MOVE_DURATION = 0.05

def commands(command)
::Appium::Core::Commands::COMMANDS_EXTEND_W3C[command]
end
Expand Down
16 changes: 14 additions & 2 deletions test/functional/android/webdriver/w3c_actions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,25 @@ def teardown
end

def test_tap
skip if @@driver.dialect
skip if @@driver.dialect == :oss

el = @@core.wait { @@driver.find_element(:accessibility_id, 'Views') }
@@driver.action.click(el).perform

el = @@core.wait { @@driver.find_element(:accessibility_id, 'Custom') }
@@driver.action.click_and_hold(el).move_to_location(0, 700).release.perform
# same as @@driver.action.click_and_hold(el).move_to_location(0, 700).release.perform
@@driver.action
.move_to(el).pointer_down(:left)
.move_to_location(0, 700)
.release
.perform

# Scroll a bit without elements
@@driver.action
.move_to_location(500, 500).pointer_down(:left)
.move_to_location(0, 700)
.release
.perform

el = @@core.wait { @@driver.find_element(:accessibility_id, 'ImageButton') }
assert_equal 'ImageButton', el.name
Expand Down
2 changes: 1 addition & 1 deletion test/functional/ios/webdriver/w3c_actions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def teardown
end

def test_tap
skip if @@driver.dialect
skip if @@driver.dialect == :oss

el = @@core.wait { @@driver.find_element(:accessibility_id, 'Buttons') }
@@driver.action.click(el).perform
Expand Down