Test.timeouts Method

Customize timeout values for requests performed during a test.

test.timeouts({
    [pageLoadTimeout]
    [, 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.
fixture`Test.timeouts`
    .page`https://devexpress.github.io/testcafe/example`;

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