diff options
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/images.spec.js | 5 | ||||
-rw-r--r-- | cypress/support/commands.js | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/cypress/e2e/images.spec.js b/cypress/e2e/images.spec.js index 2066a36c8..fff9cbfc1 100644 --- a/cypress/e2e/images.spec.js +++ b/cypress/e2e/images.spec.js @@ -162,6 +162,7 @@ describe('Test all image insertion methods', () => { it('Insert an image from files', () => { cy.openFile('test.md') + clickOnImageAction(ACTION_INSERT_FROM_FILES) .then(() => { const requestAlias = 'insertPathRequest' @@ -172,7 +173,7 @@ describe('Test all image insertion methods', () => { cy.log('Click OK in the filepicker') cy.get('.oc-dialog > .oc-dialog-buttonrow button').click() - waitForRequestAndCheckImage(requestAlias) + return waitForRequestAndCheckImage(requestAlias) }) }) @@ -195,7 +196,9 @@ describe('Test all image insertion methods', () => { it('Upload images with the same name', () => { // make sure we start from an emtpy file even on retries const filename = randHash() + '.md' + cy.uploadFile('empty.md', 'text/markdown', filename) + cy.reloadFileList() cy.openFile(filename) const assertImage = index => { diff --git a/cypress/support/commands.js b/cypress/support/commands.js index e10fd9619..4b3a5e94c 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -163,26 +163,26 @@ Cypress.Commands.add('shareFileToUser', (userId, password, path, targetUserId) = }) Cypress.Commands.add('createFolder', dirName => { - cy.window().then(win => { + return cy.window().then(win => { return win.OC.Files.getClient().createDirectory(dirName) }) }) Cypress.Commands.add('moveFile', (path, destinationPath) => { - cy.window().then(win => { - win.OC.Files.getClient().move(path, destinationPath) + return cy.window().then(win => { + return win.OC.Files.getClient().move(path, destinationPath) }) }) Cypress.Commands.add('copyFile', (path, destinationPath) => { - cy.window().then(win => { - win.OC.Files.getClient().copy(path, destinationPath) + return cy.window().then(win => { + return win.OC.Files.getClient().copy(path, destinationPath) }) }) Cypress.Commands.add('reloadFileList', () => { - cy.window().then(win => { - win.OCA?.Files?.App?.fileList?.reload() + return cy.window().then(win => { + return win.OCA?.Files?.App?.fileList?.reload() }) }) |