Test.timeouts Method

Customize timeout values for requests performed during a test.

    [, pageRequestTimeout]
    [, ajaxRequestTimeout]
}) → this
Parameter Value Description
pageLoadTimeout (optional) number (milliseconds) Defines the maximum amount of time between the DOMContentLoaded event and the window.load event. TestCafe applies the timeout when the user delays test execution until the window.loadEventRaised event.
pageRequestTimeout (optional) number (milliseconds) Maximum time (in milliseconds) for the web server to serve an HTML page. See pageRequestTimeout.
ajaxRequestTimeout (optional) number (milliseconds) Maximum time (in milliseconds) between a fetch/XHR request and the response. See ajaxRequestTimeout.

test('My test', async () => {
    /* ... */
    pageLoadTimeout:    2000,
    pageRequestTimeout: 60000,
    ajaxRequestTimeout: 60000,