diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-01 12:29:15 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-01 12:29:15 +0200 |
commit | 7e2bea65509938791f8f10a5e3621ba2304e9552 (patch) | |
tree | 4aecf6ece1ef49b2bff978bad0f9f297d04f93ad /cypress/e2e/files | |
parent | 8dd169601d2890d4208f9d99760a6164ac6d1da8 (diff) | |
download | nextcloud-server-7e2bea65509938791f8f10a5e3621ba2304e9552.tar.gz nextcloud-server-7e2bea65509938791f8f10a5e3621ba2304e9552.zip |
test(cypress): Await promise in response to prevent timeout
The idea is to intercept the request,
then test the loading state,
and after the tests continue the request.
Problem here: `cy.intercept` has a timeout on the request-handler
which uses the same timeout as DOM assertions (4s) we could increase it,
but this also will increase DOM assertion timeout.
So instead we do not await in the request handler, but in the response handler.
This should use the response timeout which is much higher (30s).
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress/e2e/files')
-rw-r--r-- | cypress/e2e/files/files-renaming.cy.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cypress/e2e/files/files-renaming.cy.ts b/cypress/e2e/files/files-renaming.cy.ts index 3d5f23e9d45..9ac96a398b8 100644 --- a/cypress/e2e/files/files-renaming.cy.ts +++ b/cypress/e2e/files/files-renaming.cy.ts @@ -78,7 +78,10 @@ describe('files: Rename nodes', { testIsolation: true }, () => { cy.intercept( 'MOVE', /\/remote.php\/dav\/files\//, - async () => { await promise }, + (request) => { + // we need to wait in the onResponse handler as the intercept handler times out otherwise + request.on('response', async () => { await promise }) + }, ).as('moveFile') // Start the renaming |