nightwatch
Version:
Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.
22 lines (18 loc) • 765 B
JavaScript
const ProtocolAction = require('./_base-action.js');
/**
* Submit a FORM element. The submit command may also be applied to any element that is a descendant of a FORM element.
*
* @method submit
* @param {string} webElementId The [Web Element ID](https://www.w3.org/TR/webdriver1/#dfn-web-elements) of the element to route the command to.
* @param {function} [callback] Optional callback function to be called when the command finishes.
* @api protocol.elementinternal
*/
module.exports = class Session extends ProtocolAction {
static get isTraceable() {
return true;
}
command(webElementId, callback) {
ProtocolAction.validateElementId(webElementId, 'submit');
return this.transportActions.elementSubmit(webElementId, callback);
}
};