From 561240b88acf615ed32f8b27228e9274e7133104 Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Wed, 13 Nov 2024 14:19:10 +0100 Subject: [PATCH] flaky specs --- e2e/cypress/e2e/operator.cy.js | 6 ++++++ e2e/cypress/e2e/user.cy.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/e2e/cypress/e2e/operator.cy.js b/e2e/cypress/e2e/operator.cy.js index 000f77dc..61296df0 100644 --- a/e2e/cypress/e2e/operator.cy.js +++ b/e2e/cypress/e2e/operator.cy.js @@ -24,6 +24,12 @@ describe('Operator', function () { cy.get('#input-details').clear().type('Details about Interholco'); cy.get('#input-website').clear().type('https://example.com'); cy.get('#input-address').clear().type('Some address'); + // clear old image if exists + cy.get(".file-button").then(($button) => { + if ($button.length) { + cy.wrap($button).click(); + } + }); cy.get('.file-dropzone').attachFile('acme-logo.png', { subjectType: 'drag-n-drop' }); cy.get('button').contains('Update producer').click(); cy.get('.rrt-text', {timeout: 35000}).should('have.text', 'Profile saved correctly'); diff --git a/e2e/cypress/e2e/user.cy.js b/e2e/cypress/e2e/user.cy.js index b4d64a90..de505b3d 100644 --- a/e2e/cypress/e2e/user.cy.js +++ b/e2e/cypress/e2e/user.cy.js @@ -46,12 +46,12 @@ describe('User', () => { cy.get('#input-email').type('testoperator@example.com'); cy.get('#input-password').type('password'); cy.get('#input-password_confirmation').type('password2'); - cy.get('button').contains('Sign up').click(); cy.contains('.error', 'The field is required'); + cy.contains('.error', 'The field should have at least 10 characters'); cy.contains('.error', 'The field should have at least one capital (uppercase) letter'); cy.contains('.error', 'The field should have at least one digit'); - cy.contains('.error', 'The field should have at least 10 characters'); cy.contains('.error', 'The field should be equal to password'); + cy.get('button').contains('Sign up').click(); cy.get('.rrt-text').should('have.text', 'Fill all the required fields'); cy.get('#input-password').clear().type('Superpassword1'); cy.get('#input-password_confirmation').clear().type('Superpassword1');