Clicking 'OK' on alert or confirm dialog through jquery/javascript? -
i thinking of writing ui tests in backbone.js , jquery. may not best way it's thinking - automate tests without record , playback - through plain code.
the thing made me scratch head using approach this: in 'use-case flow' (of execution) confirm/alert dialogs show up. i'd click 'ok' , continue flow - doable through plain javascript code? how?
note: know gui testing libraries exist, want know how using jquery/javascript code, if @ possible.
as far know if use standard alert()
call cannot trigger "ok" click because alert call blocks normal js event loop.
however should able replace window.alert
, window.confirm
own function nothing:
window.alert = function() { console.log.apply(console, arguments); };
place these @ top of js before else loaded , subsequent calls alert()
or confirm()
call these instead.
Comments
Post a Comment