Skip to content

iOS: fire touchstart and touchend on click event #61

@wkeese

Description

@wkeese

Calling click() against iOS sends a POST element/5000/click over the wire, which does not produce touchstart and touchend events. It would be good for leadfoot to work around that selenium bug by producing the events synthetically.

Happens at least on iOS 9 on SauceLabs, which is apparently running Appium v1.4.11.

A simple test file is:

<!DOCTYPE HTML>
<html>
<body>

<span id="click" ontouchstart="log.innerHTML+='touchstart';" ontouchend="log.innerHTML+=' touchend';"
onclick="log.innerHTML+=' click';">
click me
</span>

<br>
Log: <span id="log"></span>

</body>
</html>

with the driver file as:

define([
"require",
"intern",
"intern!object",
"intern/chai!assert"
], function (require, intern, registerSuite, assert) {

registerSuite({
name: "touchstart event on click",

basic: function () {
return this.remote
.get(require.toUrl("./touchclick.html"))
.findById("click").click().end()
.findById("log").getVisibleText()
.then(function (text) {
assert.strictEqual(text, "touchstart touchend click");
});
}
});
});

This ticket is different than #17, although related.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions