Closed maitriyogin closed 7 years ago
I am also having this same problem. No touchTap events work at all :(
+1
How does onClick
behave?
onTouchTap
is provided by an external dependency that has already been removed on next
.
I am also experiencing this problem. Has anyone found a solution? I have the same use case as @maitriyogin with Nightmarejs.
I found I am able to 'click' on the element programmatically with this code:
var t = new Touch({
identifier: Date.now(),
target: document.querySelector('button'),
clientX: 100,
clientY: 100,
radiusX: 2.5,
radiusY: 2.5,
rotationAngle: 10,
force: 0.5,
});
var touchEvent = new TouchEvent('touchend', {
cancelable: true,
bubbles: true,
touches: [t],
targetTouches: [],
changedTouches: [t],
shiftKey: true,
});
document.querySelector('button').dispatchEvent(touchEvent)
Many thanks to this StackOverflow comment for leading me to the answer: http://stackoverflow.com/a/42447620/935473
This can be closed.
Hi, I'm currently experimenting with the test runner Nightmarejs and having a nightmare trying to simulate a touchTap on all MUI buttons. I'm wondering if theres a particular way to deal with touchTap in Electron and also nightmare ? I'v included
in my index.js and can happily click or touch tap those buttons in chrome/safari also via night watch via selenium. But not in Electron with Nightmarejs ... Any ideas would be hugely appreciated. /Stephen.