Skip to content

Commit

Permalink
test: try to make image test retryable
Browse files Browse the repository at this point in the history
Use a unique filename so retries work on different files.

Uploading the existing file again would cause a conflict
resulting in retries failing.

Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud authored and vinicius73 committed Jun 30, 2022
1 parent c1f712c commit bd1de5b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cypress/e2e/images.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ describe('Test all image insertion methods', () => {

// Upload test files to user's storage
cy.uploadFile('test.md', 'text/markdown')
cy.uploadFile('empty.md', 'text/markdown')
cy.uploadFile('github.png', 'image/png')

cy.nextcloudCreateUser(randUser2, 'password')
Expand Down Expand Up @@ -198,8 +197,10 @@ describe('Test all image insertion methods', () => {
})

it('Upload images with the same name', () => {
cy.uploadFile('empty.md', 'text/markdown')
cy.openFile('empty.md')
// make sure we start from an emtpy file even on retries
const filename = randHash() + '.md'
cy.uploadFile('empty.md', 'text/markdown', filename)
cy.openFile(filename)

const assertImage = index => {
return clickOnImageAction(ACTION_UPLOAD_LOCAL_FILE)
Expand Down

0 comments on commit bd1de5b

Please sign in to comment.