forked from enviPath/enviPy
Current Dev State
This commit is contained in:
26
static/js/ketcher2/node_modules/webdriverio/lib/commands/touch.js
generated
vendored
Normal file
26
static/js/ketcher2/node_modules/webdriverio/lib/commands/touch.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Put finger on an element (only in mobile context).
|
||||
*
|
||||
* @alias browser.touch
|
||||
* @param {String} selector element to put finger on
|
||||
* @param {Boolean} longClick if true touch click will be long (default: false)
|
||||
* @uses property/getLocation, protocol/touchClick
|
||||
* @type mobile
|
||||
* @uses android
|
||||
*
|
||||
*/
|
||||
|
||||
let touch = function (selector, longClick) {
|
||||
/**
|
||||
* we can't use default values for function parameter here because this would
|
||||
* break the ability to chain the command with an element if reverse is used
|
||||
*/
|
||||
longClick = typeof longClick === 'boolean' ? longClick : false
|
||||
|
||||
const touchCommand = longClick ? 'touchLongClick' : 'touchClick'
|
||||
|
||||
return this.getLocation(selector).then((val) =>
|
||||
this[touchCommand](val.x, val.y))
|
||||
}
|
||||
|
||||
export default touch
|
||||
Reference in New Issue
Block a user