woocommerce/plugins/woocommerce-admin/tests/e2e/utils/lib.js

11 lines
245 B
JavaScript

export const waitForElementCount = function ( page, domSelector, count ) {
return page.waitForFunction(
( domSelector, count ) => {
return document.querySelectorAll( domSelector ).length === count;
},
{},
domSelector,
count
);
};