
| Current Path : /var/www/html/sirius-pallets/web/core/tests/Drupal/Nightwatch/Assertions/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/sirius-pallets/web/core/tests/Drupal/Nightwatch/Assertions/elementCount.js |
module.exports.assertion = function (selector, count) {
this.message = `Testing if element <${selector}> has count: ${count}`;
this.expected = count;
this.pass = function (val) {
return val === this.expected;
};
this.value = function (res) {
return res.value;
};
this.command = function (cb) {
const self = this;
return this.api.execute(
function (selector) {
return document.querySelectorAll(selector).length;
},
[selector],
function (res) {
cb.call(self, res);
},
);
};
};