MCPcopy
hub / github.com/codeceptjs/CodeceptJS / resizeWindow

Method resizeWindow

lib/helper/Playwright.js:1470–1477  ·  view source on GitHub ↗

* * Unlike other drivers Playwright changes the size of a viewport, not the window! * Playwright does not control the window of a browser, so it can't adjust its real size. * It also can't maximize a window. * * Update configuration to change real window size on start: * * ```js

(width, height)

Source from the content-addressed store, hash-verified

1468 * {{> resizeWindow }}
1469 */
1470 async resizeWindow(width, height) {
1471 if (width === 'maximize') {
1472 throw new Error("Playwright can't control windows, so it can't maximize it")
1473 }
1474
1475 await this.page.setViewportSize({ width, height })
1476 return this._waitForAction()
1477 }
1478
1479 /**
1480 * Set headers for all next requests

Callers

nothing calls this directly

Calls 1

_waitForActionMethod · 0.95

Tested by

no test coverage detected