From 3bfa378872d31ac8348ad6210e2ca711195f92e7 Mon Sep 17 00:00:00 2001 From: Vinicius Reis Date: Thu, 30 Jun 2022 14:59:04 -0300 Subject: =?UTF-8?q?=E2=9C=85=20(#2584):=20fix=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vinicius Reis --- cypress/e2e/images.spec.js | 5 ++++- cypress/support/commands.js | 14 +++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'cypress') 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() }) }) -- cgit v1.2.3