bigbluebutton-Github/bigbluebutton-tests/playwright/core/util.js
2022-02-07 15:45:42 -03:00

18 lines
546 B
JavaScript

// Common
function checkElement([element, index = 0]) {
return document.querySelectorAll(element)[index] !== undefined;
}
// Length
function checkElementLengthEqualTo([element, count]) {
return document.querySelectorAll(element).length == count;
}
function checkIncludeClass([selector, className]) {
return document.querySelectorAll(`${selector} > div`)[0].className.includes(className);
}
exports.checkElement = checkElement;
exports.checkElementLengthEqualTo = checkElementLengthEqualTo;
exports.checkIncludeClass = checkIncludeClass;