UNPKG

nightwatch

Version:

Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.

33 lines (28 loc) 670 B
const ClientCommand = require('./_base-command.js'); /** * Returns the page source. * * @example * this.demoTest = function (browser) { * browser.pageSource(function(pageSource) { * console.log(pageSource); * }); * }; * * * @method pageSource * @syntax .pageSource(callback) * @param {function} callback Callback function which is called with the result value. * @see pageSource * @returns {string} The page source. * @api protocol.pageSource */ class PageSource extends ClientCommand { get returnsFullResultObject() { return true; } performAction(callback) { this.api.source(callback); } } module.exports = PageSource;