Skip to content

Commit

Permalink
fix: take retry into account for test folders
Browse files Browse the repository at this point in the history
Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Jul 3, 2022
1 parent 916e0c2 commit c51b7e1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ 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.login(randUser, 'password').then(() => {
// isolate tests - each happens in its own folder
const retry = cy.state('test').currentRetry()
const folderName = retry
? `${Cypress.currentTest.title} (${retry})`
: Cypress.currentTest.title
cy.createFolder(folderName)
cy.visit(`apps/files?dir=/${encodeURIComponent(folderName)}`)
})
})

it('adds a Readme.md', function() {
Expand Down

0 comments on commit c51b7e1

Please sign in to comment.