Promise To Wait For Download with custom timeout argument
Currently when I would like to have a custom timeout for this keyword, I would need to use the following workaround:
Suppose the default browser timeout is set globally on suite setup:
Suite Setup
New Context acceptDownloads=True
Set Browser Timeout ${DEFAULT_WAIT}
...
Then on specific test case, I would need a custom timeout, expecting a longer than normal download timeout:
Test Case
New Page ${LOGIN_URL}
Set Browser Timeout ${LONG_WAIT}
${dl_promise} Promise To Wait For Download /path/to/download/folder
Click \#file_download
# Restore default timeout if download fails
${status} ${file_obj} Run Keyword And Ignore Error Wait For ${dl_promise}
Set Browser Timeout ${DEFAULT_WAIT}
IF '${status}' == 'FAIL'
Take Screenshot
Fail ${file_obj}
END
File Should Exist ${file_obj}[saveAs]
Should Be True ${file_obj.suggestedFilename}
Considering this, it would be useful if Promise To Wait For Download keyword could have a default timeout argument, like e.g. Wait For Request keyword, if possible.
@all-contributors please add @adrian-evo for ideas
Fully agree that ability to set custom timeout for Promise To Wait For Download would be useful especially for cases when file is generated and longer waiting time is expected.
Will be fixed/implemented with #3228