refactor app directory structure and add tests

This commit is contained in:
s2
2016-11-10 16:27:26 +01:00
parent 204834ce28
commit dd88218c0e
1844 changed files with 263520 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/**
* Class that all elements subclass from
*
* @param {Object} options Element options defined in page object
* @constructor
*/
function Element(options) {
this.parent = options.parent;
if (!options.selector) {
throw new Error('No selector property for element "' + options.name +
'" Instead found properties: ' + Object.keys(options));
}
this.name = options.name;
this.selector = options.selector;
this.locateStrategy = options.locateStrategy || 'css selector';
}
Element.prototype.toString = function() {
return 'Element[name=@' + this.name + ']';
};
module.exports = Element;