UNPKG

nightwatch

Version:

Easy to use Node.js based End-to-End testing solution for browser based apps and websites, using the W3C WebDriver API.

19 lines (15 loc) 429 B
/** * Simple example of custom command. This command will * check if there's a onbeforeunload handler in the target web page * and return the result */ /* global window */ module.exports.command = function(callback) { var self = this; this.execute(function() { return window && typeof window.onbeforeunload === 'function'; }, [], function(result) { callback.call(self, result.value); }); return this; };