Test.timeouts Method

Customize timeout values for requests performed during a test.

test.timeouts({
    [pageLoadTimeout]
    [, pageRequestTimeout]
    [, ajaxRequestTimeout]
}) → this
Parameter Type Description
pageLoadTimeout (optional) number Maximum time (in milliseconds) between theDOMContentLoaded event and the window.load event. See pageLoadTimeout.
pageRequestTimeout (optional) number Maximum time (in milliseconds) for the web server to serve an HTML page. See pageRequestTimeout.
ajaxRequestTimeout (optional) number 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,
});