javascript - "Click" MouseEvent on some elements not displaying in screenshots -


i'm trying simulate clicking of css elements on page , automatically take screenshots of window @ each stage testing purposes. i'm using backstopjs css testing/screenshot framework. seems work fine first element. ng-click triggered expands menu (and visible in screenshots), , prints console message:

<li class="hidden-toggle" ng-click="hiddentoggle = !hiddentoggle"  ng-init="hiddentoggle=false" onclick="console.log('toggled hidden');"> ... </li> 

but when try screenshot alert box when clicking same element, doesn't show up:

<li class="hidden-toggle" ng-click="hiddentoggle = !hiddentoggle"  ng-init="hiddentoggle=false" onclick="alert('toggled hidden');"> ... </li> 

my function simulate click:

array.prototype.foreach.call(document.queryselectorall(o), function(s, j) {         var ev = document.createevent("mouseevent");         ev.initmouseevent(             "click",             true, false,             window, null,             0, 0, 0, 0,             false, false, false, false,             0, null         );         s.dispatchevent(ev); 

so onclicks being triggered can't see alert box in screenshots being taking. true elements try display modals. added onclicks after time test if elements being clicked, doubt interfering in way.

any ideas causing behavior?

if onclicks being activated may have issue triggering backstopjs take screenshot @ correct time. might check out article (towards end) covers triggering backstopjs screenshots in angular.

http://davidwalsh.name/visual-regression-testing-angular-applications

hope helps.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -