mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
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>
This commit is contained in:
parent
8dd169601d
commit
7e2bea6550
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue