refactor app directory structure and add tests
This commit is contained in:
18
tests/node_modules/nightwatch/examples/custom-commands/hasOnBeforeUnload.js
generated
vendored
Normal file
18
tests/node_modules/nightwatch/examples/custom-commands/hasOnBeforeUnload.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* 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;
|
||||
};
|
Reference in New Issue
Block a user