
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
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
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.