
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Touch Action is a Ruby Gem used to add touch gestures simulation to the Watir-WebDriver, Selenium-WebDriver and Capybara in order to perform automated tests on (mobile and desktops) websites that requires those type of actions. It encapsulates the touch action library of YUI JS. Very useful for example when testing mobile websites using Appium.
Add this line to your application's Gemfile:
gem 'touch_action'
And then execute:
$ bundle
And then add require 'touch_action'
to your spec_helper.rb or wherever you want to use it.
On the element you want to perform the action, just call touch_action(:name_of_gesture). It currently supports Selenium, Watir-Webdriver and Capybara elements. Here's the example using a Watir element.
element = @driver.div(:id, 'hit')
element.touch_action(:swipe)
###Available Gestures
It's currently supporting the gestures bellow. The only required argument is the action symbol, the rest are optional (here it's showing the default options for each action).
element.touch_action(:flick, axis: 'x', distance: 100, duration: 50) #flick and swipe are the same
element.touch_action(:pinch, r1: 50, r2: 100)
element.touch_action(:tap)
element.touch_action(:doubletap)
element.touch_action(:press, hold: 2000)
element.touch_action(:move, xdist: 70, ydist: -50, duration: 500)
element.touch_action(:rotate, {rotation: -75})
###Capybara and RSpec
To use it with Capybara and Rspec, just do the following:
it "should tap using capybara", js: true do
visit('http://mywebsite.com')
touch_action '#myElement', :tap #it will also accept options here
end
For more information about how those methods work, please check the YUI Documentation.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that touch_action demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.