diff options
author | Max <max@nextcloud.com> | 2022-06-07 23:13:07 +0300 |
---|---|---|
committer | Max <max@nextcloud.com> | 2022-06-08 00:11:06 +0300 |
commit | 0162bb016c9b3f32f4583144eadd16bd1cfe68e7 (patch) | |
tree | 66016cbee531b81f20c713901d447ded703f04ad /cypress | |
parent | b1ccb60cb6a0d9265e145f7db750add1e832e52d (diff) |
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 <max@nextcloud.com>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/workspace.spec.js | 4 | ||||
-rw-r--r-- | cypress/support/commands.js | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/cypress/e2e/workspace.spec.js b/cypress/e2e/workspace.spec.js index 1983b7b93..9273bc8d8 100644 --- a/cypress/e2e/workspace.spec.js +++ b/cypress/e2e/workspace.spec.js @@ -173,10 +173,6 @@ describe('Workspace', function() { }) beforeEach(function() { - cy.login(randUser, 'password') - // isolate tests - each happens in it's own folder - cy.createFolder(Cypress.currentTest.title) - cy.visit(`apps/files?dir=/${encodeURIComponent(Cypress.currentTest.title)}`) cy.openWorkspace().type('Callout') }) // eslint-disable-next-line cypress/no-async-tests diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 4bfa8149a..482b50e2f 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) }) }) |