Update:
Since Protractor returns a Selenium element finder not an angular element, you'll have to use the executeScript()
function to call a JavaScript method on it, like:
var poster = element(by.css('.video-poster'));
browser.executeScript(
'angular.element(arguments[0]).triggerHandler("touchstart");', poster);
Original:
You should be able to trigger the event, like:
element(poster).triggerHandler("touchstart");
If you need more stuff in the event object, you can create one like this answer: jQuery Trigger Event in AngularJS Karma Test
Note:
It seems Angular does not provide you with trigger()
method like jQuery, only triggerHandler()
, as per https://docs.angularjs.org/api/ng/function/angular.element