From c51b7e1367ae358b3f48f9c194b94e53416db1df Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 3 Jul 2022 07:54:32 +0200 Subject: [PATCH] fix: take retry into account for test folders Signed-off-by: Max --- cypress/e2e/workspace.spec.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/workspace.spec.js b/cypress/e2e/workspace.spec.js index 37bc71335cf..5d78763bb81 100644 --- a/cypress/e2e/workspace.spec.js +++ b/cypress/e2e/workspace.spec.js @@ -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() {