Prettify codebase
This commit is contained in:
@ -13,22 +13,22 @@
|
||||
*/
|
||||
|
||||
exports.assertion = function elementCount(selectorOrObject, count) {
|
||||
let selector;
|
||||
let selector
|
||||
|
||||
// when called from a page object element or section
|
||||
if (typeof selectorOrObject === "object" && selectorOrObject.selector) {
|
||||
if (typeof selectorOrObject === 'object' && selectorOrObject.selector) {
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
selector = selectorOrObject.selector;
|
||||
selector = selectorOrObject.selector
|
||||
} else {
|
||||
selector = selectorOrObject;
|
||||
selector = selectorOrObject
|
||||
}
|
||||
|
||||
this.message = `Testing if element <${selector}> has count: ${count}`;
|
||||
this.expected = count;
|
||||
this.pass = val => val === count;
|
||||
this.value = res => res.value;
|
||||
this.message = `Testing if element <${selector}> has count: ${count}`
|
||||
this.expected = count
|
||||
this.pass = (val) => val === count
|
||||
this.value = (res) => res.value
|
||||
function evaluator(_selector) {
|
||||
return document.querySelectorAll(_selector).length;
|
||||
return document.querySelectorAll(_selector).length
|
||||
}
|
||||
this.command = cb => this.api.execute(evaluator, [selector], cb);
|
||||
};
|
||||
this.command = (cb) => this.api.execute(evaluator, [selector], cb)
|
||||
}
|
||||
|
Reference in New Issue
Block a user