From 5190876dd93252027612c3ed5876c961e43a8cf7 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 5 Jun 2024 14:08:04 +0200 Subject: [PATCH 01/19] chore: ignore resize observer issues in test teardown --- frontend/cypress/integration/feature/feature.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/cypress/integration/feature/feature.spec.ts b/frontend/cypress/integration/feature/feature.spec.ts index ec3dd69b8018..518ca9d42f43 100644 --- a/frontend/cypress/integration/feature/feature.spec.ts +++ b/frontend/cypress/integration/feature/feature.spec.ts @@ -15,6 +15,18 @@ describe('feature', () => { }); after(() => { + cy.on('uncaught:exception', (err) => { + if ( + err.message.includes( + 'ResizeObserver loop completed with undelivered notifications', + ) + ) { + // ignore resize observer errors + // returning false here prevents Cypress from failing the test + return false; + } + }); + cy.deleteFeature_API(featureToggleName, projectName); cy.deleteProject_API(projectName); }); From 9c0dfd1d20a2da1fcfa78cbf8d4a3dc002db940f Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 5 Jun 2024 14:09:01 +0200 Subject: [PATCH 02/19] chore: remove unused variables --- frontend/cypress/integration/feature/feature.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/frontend/cypress/integration/feature/feature.spec.ts b/frontend/cypress/integration/feature/feature.spec.ts index 518ca9d42f43..1980285daf9b 100644 --- a/frontend/cypress/integration/feature/feature.spec.ts +++ b/frontend/cypress/integration/feature/feature.spec.ts @@ -5,9 +5,6 @@ describe('feature', () => { const featureToggleName = `unleash-e2e-${randomId}`; const projectName = `unleash-e2e-project-${randomId}`; - const variant1 = 'variant1'; - const variant2 = 'variant2'; - before(() => { cy.runBefore(); cy.login_UI(); From 29c209ed5c38a23fb8785cc4a9799c8c8ae2a347 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 5 Jun 2024 14:10:04 +0200 Subject: [PATCH 03/19] chore: add comment to trigger tests --- .../project/NewProjectCard/ProjectOwners/ProjectOwners.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx b/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx index 7a4c40a50a38..90b0c98b5699 100644 --- a/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx +++ b/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx @@ -54,6 +54,7 @@ export const ProjectOwners: FC = ({ owners = [] }) => { const ownersMap = useOwnersMap(); const users = owners.map(ownersMap); + // this is just here to make sure we trigger the tests. Delete before merging! return ( <> Date: Wed, 5 Jun 2024 14:17:24 +0200 Subject: [PATCH 04/19] chore: always run e2e test (delete later) --- .github/workflows/e2e.frontend.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.frontend.yaml b/.github/workflows/e2e.frontend.yaml index b9eaa4682683..5fbc71461486 100644 --- a/.github/workflows/e2e.frontend.yaml +++ b/.github/workflows/e2e.frontend.yaml @@ -2,7 +2,7 @@ name: e2e:frontend on: [deployment_status] jobs: e2e: - if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.target_url, 'unleash-monorepo-frontend') + if: true runs-on: ubuntu-latest strategy: matrix: From add7ccb1beb1f9daaefb1a4e74b7ac3c70f5fc22 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 5 Jun 2024 14:21:13 +0200 Subject: [PATCH 05/19] Revert "chore: always run e2e test (delete later)" This reverts commit 717c844c1475919da9275495d8d62506332a5e02. --- .github/workflows/e2e.frontend.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.frontend.yaml b/.github/workflows/e2e.frontend.yaml index 5fbc71461486..b9eaa4682683 100644 --- a/.github/workflows/e2e.frontend.yaml +++ b/.github/workflows/e2e.frontend.yaml @@ -2,7 +2,7 @@ name: e2e:frontend on: [deployment_status] jobs: e2e: - if: true + if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.target_url, 'unleash-monorepo-frontend') runs-on: ubuntu-latest strategy: matrix: From a024c2a2dd7d25caf630ecee5bb1a99ecca640ef Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 5 Jun 2024 14:22:36 +0200 Subject: [PATCH 06/19] Revert "chore: add comment to trigger tests" This reverts commit 29c209ed5c38a23fb8785cc4a9799c8c8ae2a347. --- .../project/NewProjectCard/ProjectOwners/ProjectOwners.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx b/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx index 90b0c98b5699..7a4c40a50a38 100644 --- a/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx +++ b/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx @@ -54,7 +54,6 @@ export const ProjectOwners: FC = ({ owners = [] }) => { const ownersMap = useOwnersMap(); const users = owners.map(ownersMap); - // this is just here to make sure we trigger the tests. Delete before merging! return ( <> Date: Thu, 6 Jun 2024 08:08:32 +0200 Subject: [PATCH 07/19] chore: add log statement --- frontend/cypress/integration/feature/feature.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/cypress/integration/feature/feature.spec.ts b/frontend/cypress/integration/feature/feature.spec.ts index 1980285daf9b..8ebff0499b8f 100644 --- a/frontend/cypress/integration/feature/feature.spec.ts +++ b/frontend/cypress/integration/feature/feature.spec.ts @@ -18,6 +18,10 @@ describe('feature', () => { 'ResizeObserver loop completed with undelivered notifications', ) ) { + cy.log( + 'Ignored an uncaught resize observer error:', + err.message, + ); // ignore resize observer errors // returning false here prevents Cypress from failing the test return false; From e40050f85c809c37de96cda380f13d7bd2e47765 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 08:11:46 +0200 Subject: [PATCH 08/19] chore: use console.log instead --- frontend/cypress/integration/feature/feature.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/integration/feature/feature.spec.ts b/frontend/cypress/integration/feature/feature.spec.ts index 8ebff0499b8f..662c7ab23c38 100644 --- a/frontend/cypress/integration/feature/feature.spec.ts +++ b/frontend/cypress/integration/feature/feature.spec.ts @@ -18,7 +18,7 @@ describe('feature', () => { 'ResizeObserver loop completed with undelivered notifications', ) ) { - cy.log( + console.log( 'Ignored an uncaught resize observer error:', err.message, ); From 392d8d72647bf039d647844de93705770b2b1a8f Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 08:39:05 +0200 Subject: [PATCH 09/19] chore: move ignoring of resize observer errors to setup file --- .../cypress/integration/feature/feature.spec.ts | 16 ---------------- frontend/cypress/support/e2e.ts | 13 +++++++++++++ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/frontend/cypress/integration/feature/feature.spec.ts b/frontend/cypress/integration/feature/feature.spec.ts index 662c7ab23c38..f94f42754fc9 100644 --- a/frontend/cypress/integration/feature/feature.spec.ts +++ b/frontend/cypress/integration/feature/feature.spec.ts @@ -12,22 +12,6 @@ describe('feature', () => { }); after(() => { - cy.on('uncaught:exception', (err) => { - if ( - err.message.includes( - 'ResizeObserver loop completed with undelivered notifications', - ) - ) { - console.log( - 'Ignored an uncaught resize observer error:', - err.message, - ); - // ignore resize observer errors - // returning false here prevents Cypress from failing the test - return false; - } - }); - cy.deleteFeature_API(featureToggleName, projectName); cy.deleteProject_API(projectName); }); diff --git a/frontend/cypress/support/e2e.ts b/frontend/cypress/support/e2e.ts index 598ab5f0d7fe..307add7b8115 100644 --- a/frontend/cypress/support/e2e.ts +++ b/frontend/cypress/support/e2e.ts @@ -18,3 +18,16 @@ import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') + +cy.on('uncaught:exception', (err) => { + if ( + err.message.includes( + 'ResizeObserver loop completed with undelivered notifications', + ) + ) { + console.log('Ignored an uncaught resize observer error:', err.message); + // ignore resize observer errors + // returning false here prevents Cypress from failing the test + return false; + } +}); From 288a33ba03c3187b995a80422adbbd69186ed2ae Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 10:25:33 +0200 Subject: [PATCH 10/19] chore: move handling back to the test file --- .../cypress/integration/feature/feature.spec.ts | 15 +++++++++++++++ frontend/cypress/support/e2e.ts | 13 ------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/frontend/cypress/integration/feature/feature.spec.ts b/frontend/cypress/integration/feature/feature.spec.ts index f94f42754fc9..40a57852fb29 100644 --- a/frontend/cypress/integration/feature/feature.spec.ts +++ b/frontend/cypress/integration/feature/feature.spec.ts @@ -12,6 +12,21 @@ describe('feature', () => { }); after(() => { + cy.on('uncaught:exception', (err) => { + if ( + err.message.includes( + 'ResizeObserver loop completed with undelivered notifications', + ) + ) { + console.log( + 'Ignored an uncaught resize observer error:', + err.message, + ); + // ignore resize observer errors + // returning false here prevents Cypress from failing the test + return false; + } + }); cy.deleteFeature_API(featureToggleName, projectName); cy.deleteProject_API(projectName); }); diff --git a/frontend/cypress/support/e2e.ts b/frontend/cypress/support/e2e.ts index 307add7b8115..598ab5f0d7fe 100644 --- a/frontend/cypress/support/e2e.ts +++ b/frontend/cypress/support/e2e.ts @@ -18,16 +18,3 @@ import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') - -cy.on('uncaught:exception', (err) => { - if ( - err.message.includes( - 'ResizeObserver loop completed with undelivered notifications', - ) - ) { - console.log('Ignored an uncaught resize observer error:', err.message); - // ignore resize observer errors - // returning false here prevents Cypress from failing the test - return false; - } -}); From 5b8ed32c33f2cb6896854fc97a74a4484b60cc4b Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 10:38:13 +0200 Subject: [PATCH 11/19] chore: double timeouts for segments tests --- frontend/cypress/integration/segments/segments.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/cypress/integration/segments/segments.spec.ts b/frontend/cypress/integration/segments/segments.spec.ts index 343a8e904e2d..9f22be3b2cca 100644 --- a/frontend/cypress/integration/segments/segments.spec.ts +++ b/frontend/cypress/integration/segments/segments.spec.ts @@ -19,13 +19,15 @@ describe('segments', () => { it('can create a segment', () => { cy.createSegment_UI(segmentName); - cy.contains(segmentName); + cy.contains(segmentName, { timeout: 24000 }); }); it('gives an error if a segment exists with the same name', () => { cy.get("[data-testid='NAVIGATE_TO_CREATE_SEGMENT']").click(); cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); - cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").should('be.disabled'); + cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']", { + timeout: 24000, + }).should('be.disabled'); cy.get("[data-testid='INPUT_ERROR_TEXT']").contains( 'Segment name already exists', ); @@ -33,6 +35,6 @@ describe('segments', () => { it('can delete a segment', () => { cy.deleteSegment_UI(segmentName, segmentId); - cy.contains(segmentName).should('not.exist'); + cy.contains(segmentName, { timeout: 24000 }).should('not.exist'); }); }); From 14db374b91550c323b59380833375cb265130752 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 11:17:49 +0200 Subject: [PATCH 12/19] chore: increase segment test timeout to 10s --- frontend/cypress/integration/segments/segments.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/cypress/integration/segments/segments.spec.ts b/frontend/cypress/integration/segments/segments.spec.ts index 9f22be3b2cca..ea2642170dfe 100644 --- a/frontend/cypress/integration/segments/segments.spec.ts +++ b/frontend/cypress/integration/segments/segments.spec.ts @@ -19,14 +19,14 @@ describe('segments', () => { it('can create a segment', () => { cy.createSegment_UI(segmentName); - cy.contains(segmentName, { timeout: 24000 }); + cy.contains(segmentName, { timeout: 100000 }); }); it('gives an error if a segment exists with the same name', () => { cy.get("[data-testid='NAVIGATE_TO_CREATE_SEGMENT']").click(); cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']", { - timeout: 24000, + timeout: 100000, }).should('be.disabled'); cy.get("[data-testid='INPUT_ERROR_TEXT']").contains( 'Segment name already exists', @@ -35,6 +35,6 @@ describe('segments', () => { it('can delete a segment', () => { cy.deleteSegment_UI(segmentName, segmentId); - cy.contains(segmentName, { timeout: 24000 }).should('not.exist'); + cy.contains(segmentName, { timeout: 100000 }).should('not.exist'); }); }); From 8a4bb8b7a6fbdef1263a61dc7c616123c2ea860c Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 11:31:29 +0200 Subject: [PATCH 13/19] chore: add link to mdn docs --- frontend/cypress/integration/feature/feature.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/cypress/integration/feature/feature.spec.ts b/frontend/cypress/integration/feature/feature.spec.ts index 40a57852fb29..b14f22508e7c 100644 --- a/frontend/cypress/integration/feature/feature.spec.ts +++ b/frontend/cypress/integration/feature/feature.spec.ts @@ -23,6 +23,7 @@ describe('feature', () => { err.message, ); // ignore resize observer errors + // https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#observation_errors // returning false here prevents Cypress from failing the test return false; } From dce21445777df1be98975b803025e4d6027f921f Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 11:43:49 +0200 Subject: [PATCH 14/19] chore: double input for segment name in segment creation test --- frontend/cypress/integration/segments/segments.spec.ts | 8 +++----- frontend/cypress/support/UI.ts | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/cypress/integration/segments/segments.spec.ts b/frontend/cypress/integration/segments/segments.spec.ts index ea2642170dfe..343a8e904e2d 100644 --- a/frontend/cypress/integration/segments/segments.spec.ts +++ b/frontend/cypress/integration/segments/segments.spec.ts @@ -19,15 +19,13 @@ describe('segments', () => { it('can create a segment', () => { cy.createSegment_UI(segmentName); - cy.contains(segmentName, { timeout: 100000 }); + cy.contains(segmentName); }); it('gives an error if a segment exists with the same name', () => { cy.get("[data-testid='NAVIGATE_TO_CREATE_SEGMENT']").click(); cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); - cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']", { - timeout: 100000, - }).should('be.disabled'); + cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").should('be.disabled'); cy.get("[data-testid='INPUT_ERROR_TEXT']").contains( 'Segment name already exists', ); @@ -35,6 +33,6 @@ describe('segments', () => { it('can delete a segment', () => { cy.deleteSegment_UI(segmentName, segmentId); - cy.contains(segmentName, { timeout: 100000 }).should('not.exist'); + cy.contains(segmentName).should('not.exist'); }); }); diff --git a/frontend/cypress/support/UI.ts b/frontend/cypress/support/UI.ts index 406687be26ac..d126acc6cb50 100644 --- a/frontend/cypress/support/UI.ts +++ b/frontend/cypress/support/UI.ts @@ -102,6 +102,7 @@ export const createSegment_UI = (segmentName: string): Chainable => { cy.intercept('POST', '/api/admin/segments').as('createSegment'); cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); + cy.get("[data-testid='SEGMENT_NAME_ID']").clear().type(segmentName); cy.get("[data-testid='SEGMENT_DESC_ID']").type('hello-world'); cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").click(); cy.get("[data-testid='SEGMENT_CREATE_BTN_ID']").click(); From 9fb1d22cbfb76627bfc5ba5750a6fddc46a362f3 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 11:49:29 +0200 Subject: [PATCH 15/19] chore: use wait(0) for segments --- frontend/cypress/support/UI.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/cypress/support/UI.ts b/frontend/cypress/support/UI.ts index d126acc6cb50..7c82f146c0e4 100644 --- a/frontend/cypress/support/UI.ts +++ b/frontend/cypress/support/UI.ts @@ -101,8 +101,7 @@ export const createSegment_UI = (segmentName: string): Chainable => { cy.intercept('POST', '/api/admin/segments').as('createSegment'); - cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); - cy.get("[data-testid='SEGMENT_NAME_ID']").clear().type(segmentName); + cy.get("[data-testid='SEGMENT_NAME_ID']").wait(0).type(segmentName); cy.get("[data-testid='SEGMENT_DESC_ID']").type('hello-world'); cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").click(); cy.get("[data-testid='SEGMENT_CREATE_BTN_ID']").click(); From daa5d65329a4d703bf524be77ae3b51ff80452ca Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 11:53:38 +0200 Subject: [PATCH 16/19] chore: fail if segment name is not correct --- frontend/cypress/support/UI.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/UI.ts b/frontend/cypress/support/UI.ts index 7c82f146c0e4..ce5007661035 100644 --- a/frontend/cypress/support/UI.ts +++ b/frontend/cypress/support/UI.ts @@ -101,7 +101,8 @@ export const createSegment_UI = (segmentName: string): Chainable => { cy.intercept('POST', '/api/admin/segments').as('createSegment'); - cy.get("[data-testid='SEGMENT_NAME_ID']").wait(0).type(segmentName); + cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); + cy.get("[data-testid='SEGMENT_NAME_ID']").should('have.value', segmentName); cy.get("[data-testid='SEGMENT_DESC_ID']").type('hello-world'); cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").click(); cy.get("[data-testid='SEGMENT_CREATE_BTN_ID']").click(); From 74cbe87219131749df1bbafd7e0bc33fc5889eba Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 12:02:28 +0200 Subject: [PATCH 17/19] chore: multiple input --- frontend/cypress/support/UI.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/support/UI.ts b/frontend/cypress/support/UI.ts index ce5007661035..f8c078f4acba 100644 --- a/frontend/cypress/support/UI.ts +++ b/frontend/cypress/support/UI.ts @@ -102,7 +102,8 @@ export const createSegment_UI = (segmentName: string): Chainable => { cy.intercept('POST', '/api/admin/segments').as('createSegment'); cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); - cy.get("[data-testid='SEGMENT_NAME_ID']").should('have.value', segmentName); + cy.get("[data-testid='SEGMENT_NAME_ID']").clear(); + cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); cy.get("[data-testid='SEGMENT_DESC_ID']").type('hello-world'); cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").click(); cy.get("[data-testid='SEGMENT_CREATE_BTN_ID']").click(); From 9461af27131e9d646e6b377996cb1c4a12abf066 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 14:43:01 +0200 Subject: [PATCH 18/19] chore: try to add a short timeout before creation --- frontend/cypress/integration/segments/segments.spec.ts | 1 + frontend/cypress/support/UI.ts | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/cypress/integration/segments/segments.spec.ts b/frontend/cypress/integration/segments/segments.spec.ts index 343a8e904e2d..97b99b5aaa56 100644 --- a/frontend/cypress/integration/segments/segments.spec.ts +++ b/frontend/cypress/integration/segments/segments.spec.ts @@ -18,6 +18,7 @@ describe('segments', () => { }); it('can create a segment', () => { + cy.wait(500); cy.createSegment_UI(segmentName); cy.contains(segmentName); }); diff --git a/frontend/cypress/support/UI.ts b/frontend/cypress/support/UI.ts index f8c078f4acba..406687be26ac 100644 --- a/frontend/cypress/support/UI.ts +++ b/frontend/cypress/support/UI.ts @@ -101,8 +101,6 @@ export const createSegment_UI = (segmentName: string): Chainable => { cy.intercept('POST', '/api/admin/segments').as('createSegment'); - cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); - cy.get("[data-testid='SEGMENT_NAME_ID']").clear(); cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); cy.get("[data-testid='SEGMENT_DESC_ID']").type('hello-world'); cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").click(); From 74d8591e6ca30640c244cba04c68cbc3b428f7cb Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 6 Jun 2024 14:44:03 +0200 Subject: [PATCH 19/19] chore: move wait --- frontend/cypress/integration/segments/segments.spec.ts | 1 - frontend/cypress/support/UI.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/integration/segments/segments.spec.ts b/frontend/cypress/integration/segments/segments.spec.ts index 97b99b5aaa56..343a8e904e2d 100644 --- a/frontend/cypress/integration/segments/segments.spec.ts +++ b/frontend/cypress/integration/segments/segments.spec.ts @@ -18,7 +18,6 @@ describe('segments', () => { }); it('can create a segment', () => { - cy.wait(500); cy.createSegment_UI(segmentName); cy.contains(segmentName); }); diff --git a/frontend/cypress/support/UI.ts b/frontend/cypress/support/UI.ts index 406687be26ac..aad2b6fb0fcd 100644 --- a/frontend/cypress/support/UI.ts +++ b/frontend/cypress/support/UI.ts @@ -101,6 +101,8 @@ export const createSegment_UI = (segmentName: string): Chainable => { cy.intercept('POST', '/api/admin/segments').as('createSegment'); + cy.wait(500); + cy.get("[data-testid='SEGMENT_NAME_ID']").type(segmentName); cy.get("[data-testid='SEGMENT_DESC_ID']").type('hello-world'); cy.get("[data-testid='SEGMENT_NEXT_BTN_ID']").click();