From b5de65bb8ee666c25dee8e130a5332a5d0b502ca Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 12 Jun 2024 14:06:44 +0200 Subject: [PATCH] chore: wait to input the name of the segment when checking for error messages (#7377) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change adds a wait statement before entering the name of the segment when checking for error messages that this segment name already exists. This is the same workaround that we did in https://github.com/Unleash/unleash/pull/7289, which seems to have worked. Like in that PR, using waits is still an antipattern, but it appears to be working. Maybe it’s time to look more deeply at why it happens? Why isn’t the field ready to receive input even though it’s on the page? Is it mui’s fault or ours? --- frontend/cypress/integration/segments/segments.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/cypress/integration/segments/segments.spec.ts b/frontend/cypress/integration/segments/segments.spec.ts index 343a8e904e..0affa814a6 100644 --- a/frontend/cypress/integration/segments/segments.spec.ts +++ b/frontend/cypress/integration/segments/segments.spec.ts @@ -24,6 +24,7 @@ describe('segments', () => { it('gives an error if a segment exists with the same name', () => { cy.get("[data-testid='NAVIGATE_TO_CREATE_SEGMENT']").click(); + cy.wait(500); cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").should('be.disabled'); cy.get("[data-testid='INPUT_ERROR_TEXT']").contains(