t.maximizeWindow Method


Make sure that your testing environment meets the necessary requirements before you add this method to your test suite.

Resizes the browser window to fill the screen. The method is chainable.


Browser windows retain their size between tests and fixtures. Reset window size at the beginning of tests if necessary.

The t.maximizeWindow method does not trigger the browser’s full-screen mode. Use the --start-fullscreen CLI flag to enable the full-screen mode in compatible browsers.

See the Resize Windows section of the Test Actions guide to learn about other methods that resize windows:

t.maximizeWindow() → this | Promise<any>


import { Selector } from 'testcafe';

const submitButton = Selector('#submit-button');


test('Submit button is displayed in full screen', async t => {
    await t