UNPKG

@wordpress/e2e-test-utils

Version:
19 lines (18 loc) 746 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.waitForWindowDimensions = waitForWindowDimensions; /** * 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. */ async function waitForWindowDimensions(width, height) { await page.mainFrame().waitForFunction(`window.innerWidth === ${width} && window.innerHeight === ${height}`); } //# sourceMappingURL=wait-for-window-dimensions.js.map