@wordpress/e2e-test-utils
Version:
End-To-End (E2E) test utils for WordPress.
13 lines • 614 B
JavaScript
/**
* Function that waits until the page viewport has the required dimensions.
* It is being used to address a problem where after using setViewport the execution may continue,
* without the new dimensions being applied.
* https://github.com/GoogleChrome/puppeteer/issues/1751
*
* @param {number} width Width of the window.
* @param {number} height Height of the window.
*/
export async function waitForWindowDimensions(width, height) {
await page.mainFrame().waitForFunction(`window.innerWidth === ${width} && window.innerHeight === ${height}`);
}
//# sourceMappingURL=wait-for-window-dimensions.js.map