nightwatch
Version:
Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.
29 lines (26 loc) • 618 B
JavaScript
const featuresCommands = {
getFeatureCount: function(callback) {
this.api.elements(null, this.elements.features, function (result) {
if (result.status === 0) {
var countResult = {
status: 0,
value: result.value.length
};
callback.call(this, countResult);
} else {
callback.call(this, result);
}
}.bind(this));
return this;
}
};
module.exports = {
commands: [featuresCommands],
elements: {
featuresHeading: {
selector: '#index-container h2',
index: 1
},
features: '#index-container .features h3'
}
};