I realize this is an old question, but for posterity and completeness' sake, being able to override default behavior for input
, confirm
, and alert
were added in v2.1.0 by defining a custom preload script.
I am assuming that is a confirm prompt, and the selection you want is the affirmative. By default, Nightmare will now use the default response specified by the confirm. If you want to override that behavior, you could do something to the effect of:
window.__nightmare = {};
__nightmare.ipc = require('ipc');
window.confirm = function(message, defaultResponse){
if(message == "sure to delete?")
return true;
return defaultResponse;
}
... in a custom preload file.