Skip to content

Commit

Permalink
(e2e): fix expressionStepConfig test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
tplevko committed Jan 20, 2025
1 parent 3549ea5 commit e6db8ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -41,22 +41,22 @@ 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);
cy.checkExpressionResultType('java.lang.String');
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');
Expand Down
1 change: 1 addition & 0 deletions packages/ui-tests/cypress/support/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ declare global {
// design
openGroupConfigurationTab(step: string, stepIndex?: number): Chainable<JQuery<Element>>;
openStepConfigurationTab(step: string, stepIndex?: number): Chainable<JQuery<Element>>;
openStepConfigurationTabByPath(path: string): Chainable<JQuery<Element>>;
toggleExpandGroup(groupName: string): Chainable<JQuery<Element>>;
fitToScreen(): Chainable<JQuery<Element>>;
closeStepConfigurationTab(): Chainable<JQuery<Element>>;
Expand Down
4 changes: 4 additions & 0 deletions packages/ui-tests/cypress/support/next-commands/design.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit e6db8ab

Please sign in to comment.