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`My Fixture`
    .page`http://devexpress.github.io/testcafe/example`;
test
    .timeouts({
        pageLoadTimeout:    2000,
        pageRequestTimeout: 60000,
        ajaxRequestTimeout: 60000
    })
    ('My test', async t => {
        //test actions
    })