mobilizon/js/tests/e2e/custom-assertions/elementCount.js
Thomas Citharel 4144e9ffd0
Introduce group basic federation, event new page and notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-06-03 16:01:26 +02:00

13 lines
426 B
JavaScript

export default class ElementCount {
constructor(selector, count) {
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;
}
this.command = (cb) => this.api.execute(evaluator, [selector], cb);
}
}