From a00a8f4ae2daae45cefaea3d9481fe29ac3b87d4 Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour Date: Fri, 3 Jan 2025 15:54:17 +0100 Subject: [PATCH 1/4] test: Fix flaky mapping test (no-changelog --- cypress/e2e/14-mapping.cy.ts | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/14-mapping.cy.ts b/cypress/e2e/14-mapping.cy.ts index 46448b496662b..87304c9039579 100644 --- a/cypress/e2e/14-mapping.cy.ts +++ b/cypress/e2e/14-mapping.cy.ts @@ -125,12 +125,29 @@ describe('Data mapping', () => { ndv.getters .inputDataContainer() - .should('exist') + .should('exist'); + + ndv.getters + .inputDataContainer() + .find('.json-data') + .scrollTo('top'); + + ndv.getters + .inputDataContainer() .find('.json-data') .should( 'have.text', '[{"input": [{"count": 0,"with space": "!!","with.dot": "!!","with"quotes": "!!"}]},{"input": [{"count": 1}]}]', - ) + ); + + ndv.getters + .inputDataContainer() + .find('span') + .contains('"count"') + .scrollIntoView(); + + ndv.getters + .inputDataContainer() .find('span') .contains('"count"') .realMouseDown(); From df4a5c5db246de5cae57ec2a9c4012b69f8cd809 Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour Date: Fri, 3 Jan 2025 16:21:39 +0100 Subject: [PATCH 2/4] test: increase width --- cypress/e2e/14-mapping.cy.ts | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/cypress/e2e/14-mapping.cy.ts b/cypress/e2e/14-mapping.cy.ts index 87304c9039579..ce67b93435d44 100644 --- a/cypress/e2e/14-mapping.cy.ts +++ b/cypress/e2e/14-mapping.cy.ts @@ -115,6 +115,7 @@ describe('Data mapping', () => { }); it('maps expressions from json view', () => { + cy.viewport(800, 1200); cy.fixture('Test_workflow_3.json').then((data) => { cy.get('body').paste(JSON.stringify(data)); }); @@ -123,14 +124,7 @@ describe('Data mapping', () => { workflowPage.actions.openNode('Set'); ndv.actions.switchInputMode('JSON'); - ndv.getters - .inputDataContainer() - .should('exist'); - - ndv.getters - .inputDataContainer() - .find('.json-data') - .scrollTo('top'); + ndv.getters.inputDataContainer().should('exist'); ndv.getters .inputDataContainer() @@ -140,17 +134,9 @@ describe('Data mapping', () => { '[{"input": [{"count": 0,"with space": "!!","with.dot": "!!","with"quotes": "!!"}]},{"input": [{"count": 1}]}]', ); - ndv.getters - .inputDataContainer() - .find('span') - .contains('"count"') - .scrollIntoView(); + ndv.getters.inputDataContainer().find('span').contains('"count"').scrollIntoView(); - ndv.getters - .inputDataContainer() - .find('span') - .contains('"count"') - .realMouseDown(); + ndv.getters.inputDataContainer().find('span').contains('"count"').realMouseDown(); ndv.actions.mapToParameter('value'); ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }}'); From df721ae8da5c37fc0064d1f717866e35c7cc69cb Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour Date: Fri, 3 Jan 2025 16:23:09 +0100 Subject: [PATCH 3/4] remove scrollfromview --- cypress/e2e/14-mapping.cy.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/cypress/e2e/14-mapping.cy.ts b/cypress/e2e/14-mapping.cy.ts index ce67b93435d44..952839d729545 100644 --- a/cypress/e2e/14-mapping.cy.ts +++ b/cypress/e2e/14-mapping.cy.ts @@ -134,8 +134,6 @@ describe('Data mapping', () => { '[{"input": [{"count": 0,"with space": "!!","with.dot": "!!","with"quotes": "!!"}]},{"input": [{"count": 1}]}]', ); - ndv.getters.inputDataContainer().find('span').contains('"count"').scrollIntoView(); - ndv.getters.inputDataContainer().find('span').contains('"count"').realMouseDown(); ndv.actions.mapToParameter('value'); From a56d21f9ecf8db9aa4c55f16efb43aa852923631 Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour Date: Fri, 3 Jan 2025 16:38:55 +0100 Subject: [PATCH 4/4] add comment --- cypress/e2e/14-mapping.cy.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/14-mapping.cy.ts b/cypress/e2e/14-mapping.cy.ts index 952839d729545..4ebce02d9ded3 100644 --- a/cypress/e2e/14-mapping.cy.ts +++ b/cypress/e2e/14-mapping.cy.ts @@ -115,7 +115,8 @@ describe('Data mapping', () => { }); it('maps expressions from json view', () => { - cy.viewport(800, 1200); + // ADO-3063 - followup to make this viewport global + cy.viewport('macbook-16'); cy.fixture('Test_workflow_3.json').then((data) => { cy.get('body').paste(JSON.stringify(data)); });