diff --git a/packages/ui-tests/cypress/e2e/designer/specialStepConfiguration/expressionStepConfig.cy.ts b/packages/ui-tests/cypress/e2e/designer/specialStepConfiguration/expressionStepConfig.cy.ts index d6c4d7271..2953955d3 100644 --- a/packages/ui-tests/cypress/e2e/designer/specialStepConfiguration/expressionStepConfig.cy.ts +++ b/packages/ui-tests/cypress/e2e/designer/specialStepConfiguration/expressionStepConfig.cy.ts @@ -25,7 +25,7 @@ describe('Tests for sidebar expression configuration', () => { cy.uploadFixture('flows/camelRoute/basic.yaml'); cy.openDesignPage(); - cy.openStepConfigurationTab('setHeader', 0); + cy.openStepConfigurationTabByPath('custom-node__route.from.steps.0.setHeader'); cy.selectFormTab('All'); cy.selectExpression('JQ'); cy.interactWithConfigInputObject('expression', '.id'); @@ -41,14 +41,14 @@ describe('Tests for sidebar expression configuration', () => { cy.checkNodeExist('setHeader', 2); - cy.openStepConfigurationTab('setHeader', 1); + cy.openStepConfigurationTabByPath('custom-node__route.from.steps.1.setHeader'); cy.selectFormTab('All'); cy.selectExpression('JQ'); cy.interactWithConfigInputObject('expression', '.name'); cy.addExpressionResultType('java.lang.String'); cy.interactWithConfigInputObject('trim'); - cy.openStepConfigurationTab('setHeader', 0); + cy.openStepConfigurationTabByPath('custom-node__route.from.steps.0.setHeader'); // Check the configured fields didn't disappear from the first node cy.checkConfigCheckboxObject('trim', true); @@ -56,7 +56,7 @@ describe('Tests for sidebar expression configuration', () => { cy.checkConfigInputObject('expression', '.id'); // Check the configured fields didn't disappear from the second node - cy.openStepConfigurationTab('setHeader', 0); + cy.openStepConfigurationTabByPath('custom-node__route.from.steps.1.setHeader'); cy.checkConfigCheckboxObject('trim', true); cy.addExpressionResultType('java.lang.String'); cy.checkConfigInputObject('expression', '.name'); diff --git a/packages/ui-tests/cypress/support/cypress.d.ts b/packages/ui-tests/cypress/support/cypress.d.ts index c1a693900..162ab7659 100644 --- a/packages/ui-tests/cypress/support/cypress.d.ts +++ b/packages/ui-tests/cypress/support/cypress.d.ts @@ -46,6 +46,7 @@ declare global { // design openGroupConfigurationTab(step: string, stepIndex?: number): Chainable>; openStepConfigurationTab(step: string, stepIndex?: number): Chainable>; + openStepConfigurationTabByPath(path: string): Chainable>; toggleExpandGroup(groupName: string): Chainable>; fitToScreen(): Chainable>; closeStepConfigurationTab(): Chainable>; diff --git a/packages/ui-tests/cypress/support/next-commands/design.ts b/packages/ui-tests/cypress/support/next-commands/design.ts index d25de1f10..b2e3e1c55 100644 --- a/packages/ui-tests/cypress/support/next-commands/design.ts +++ b/packages/ui-tests/cypress/support/next-commands/design.ts @@ -7,6 +7,10 @@ Cypress.Commands.add('openStepConfigurationTab', (step: string, stepIndex?: numb cy.get(`g[data-nodelabel^="${step}"]`).eq(stepIndex).click({ force: true }); }); +Cypress.Commands.add('openStepConfigurationTabByPath', (path: string) => { + cy.get(`g[data-testid="${path}"]`).click({ force: true }); +}); + Cypress.Commands.add('openGroupConfigurationTab', (group: string, groupIndex?: number) => { groupIndex = groupIndex ?? 0; cy.get(`g[data-grouplabel^="${group}"]`).eq(groupIndex).click({ force: true });