From 5ae4e58d26845f2f44ee02bc752b1a65ccbc9b1c Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 7 Jun 2022 22:13:07 +0200 Subject: [PATCH] fix: return promise in cypress command to wait for it Tests were failing because cypress proceeded with adding files to a folder that had not been created yet: https://github.com/nextcloud/text/runs/6780248454?check_suite_focus=true Do not create the callout test directory twice. Nested cypress blocks will execute `beforeEach` on all levels. Signed-off-by: Max --- cypress/support/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 80382bbe46f..89905a26a75 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -141,7 +141,7 @@ Cypress.Commands.add('shareFileToUser', (userId, password, path, targetUserId) = Cypress.Commands.add('createFolder', dirName => { cy.window().then(win => { - win.OC.Files.getClient().createDirectory(dirName) + return win.OC.Files.getClient().createDirectory(dirName) }) })