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

Method resizeWindow

lib/helper/Puppeteer.js:795–802  ·  view source on GitHub ↗

* * Unlike other drivers Puppeteer changes the size of a viewport, not the window! * Puppeteer does not control the window of a browser, so it can't adjust its real size. * It also can't maximize a window. * * {{> resizeWindow }} *

(width, height)

Source from the content-addressed store, hash-verified

793 *
794 */
795 async resizeWindow(width, height) {
796 if (width === 'maximize') {
797 throw new Error("Puppeteer can't control windows, so it can't maximize it")
798 }
799
800 await this.page.setViewport({ width, height })
801 return this._waitForAction()
802 }
803
804 /**
805 * Set headers for all next requests

Callers 8

Playwright_test.jsFile · 0.45
WebDriver_test.jsFile · 0.45
Puppeteer_test.jsFile · 0.45
testsFunction · 0.45

Calls 1

_waitForActionMethod · 0.95

Tested by

no test coverage detected