diff --git a/CHANGELOG.md b/CHANGELOG.md index a0a17655..ca1d44fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] ### Enhancements +- silence warning for pointeractions [#113](/~https://github.com/appium/ruby_lib_core/pull/113) ### Bug fixes diff --git a/lib/appium_lib_core/common/base/bridge/w3c.rb b/lib/appium_lib_core/common/base/bridge/w3c.rb index 303ba395..906b7d3d 100644 --- a/lib/appium_lib_core/common/base/bridge/w3c.rb +++ b/lib/appium_lib_core/common/base/bridge/w3c.rb @@ -5,6 +5,14 @@ module Core class Base class Bridge class W3C < ::Selenium::WebDriver::Remote::W3C::Bridge + def self.silence_warnings_redefining(&block) + warn_level = $VERBOSE + $VERBOSE = nil + result = block.call + $VERBOSE = warn_level + result + end + include Device::DeviceLock include Device::Keyboard include Device::ImeActions @@ -22,7 +30,7 @@ class W3C < ::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 + W3C.silence_warnings_redefining { ::Selenium::WebDriver::PointerActions::DEFAULT_MOVE_DURATION = 0.05 } def commands(command) ::Appium::Core::Commands::W3C::COMMANDS[command]