From e6cc24743a94783b2c95c67dc74d52bb35a03f86 Mon Sep 17 00:00:00 2001 From: tplevko Date: Tue, 20 Aug 2024 16:00:18 +0200 Subject: [PATCH] e2e - add side panel required filter field coverage --- .../sidepanelConfig/propertiesFilter.cy.ts | 39 +++++++++++++++++++ .../ui-tests/cypress/support/cypress.d.ts | 1 + .../next-commands/nodeConfiguration.ts | 6 +++ 3 files changed, 46 insertions(+) diff --git a/packages/ui-tests/cypress/e2e/designer/sidepanelConfig/propertiesFilter.cy.ts b/packages/ui-tests/cypress/e2e/designer/sidepanelConfig/propertiesFilter.cy.ts index 80aa5dc7b..b9faf750a 100644 --- a/packages/ui-tests/cypress/e2e/designer/sidepanelConfig/propertiesFilter.cy.ts +++ b/packages/ui-tests/cypress/e2e/designer/sidepanelConfig/propertiesFilter.cy.ts @@ -96,4 +96,43 @@ describe('Tests for side panel step filtering', () => { cy.get(`textarea[name="description"]`).should('exist'); cy.get(`input[name="id"]`).should('exist'); }); + + it('Side panel required fields filter', () => { + cy.uploadFixture('flows/camelRoute/basic.yaml'); + cy.openDesignPage(); + cy.openStepConfigurationTab('timer'); + cy.selectFormTab('Required'); + + cy.get(`input[name="parameters.timerName"]`).should('exist'); + cy.get(`textarea[name="description"]`).should('not.exist'); + cy.get(`input[name="id"]`).should('not.exist'); + + cy.selectReplaceNode('marshal'); + cy.chooseFromCatalog('processor', 'transacted'); + cy.openStepConfigurationTab('transacted'); + + cy.selectFormTab('Required'); + + cy.get('.pf-v5-c-alert__title').should('contain', 'No Required Field Found'); + }); + + it('Side panel to retain user specified fields filter', () => { + cy.uploadFixture('flows/camelRoute/basic.yaml'); + cy.openDesignPage(); + cy.openStepConfigurationTab('log'); + cy.selectFormTab('All'); + + cy.openStepConfigurationTab('timer'); + + cy.specifiedFormTab('All'); + cy.selectFormTab('Required'); + + cy.openStepConfigurationTab('log'); + cy.specifiedFormTab('Required'); + cy.selectFormTab('Modified'); + + cy.closeStepConfigurationTab(); + cy.openStepConfigurationTab('timer'); + cy.specifiedFormTab('Modified'); + }); }); diff --git a/packages/ui-tests/cypress/support/cypress.d.ts b/packages/ui-tests/cypress/support/cypress.d.ts index af3366e22..0da73d816 100644 --- a/packages/ui-tests/cypress/support/cypress.d.ts +++ b/packages/ui-tests/cypress/support/cypress.d.ts @@ -82,6 +82,7 @@ declare global { addSingleKVProperty(propertyName: string, key: string, value: string): Chainable>; filterFields(filter: string): Chainable>; selectFormTab(tab: string): Chainable>; + specifiedFormTab(tab: string): Chainable>; // metadata expandWrappedSection(sectionName: string): Chainable>; closeWrappedSection(sectionName: string): Chainable>; diff --git a/packages/ui-tests/cypress/support/next-commands/nodeConfiguration.ts b/packages/ui-tests/cypress/support/next-commands/nodeConfiguration.ts index 10387e5e6..73d9f3933 100644 --- a/packages/ui-tests/cypress/support/next-commands/nodeConfiguration.ts +++ b/packages/ui-tests/cypress/support/next-commands/nodeConfiguration.ts @@ -145,3 +145,9 @@ Cypress.Commands.add('selectFormTab', (value: string) => { cy.get(`[id$="${value}"]`).click(); }); }); + +Cypress.Commands.add('specifiedFormTab', (value: string) => { + cy.get('div.form-tabs').within(() => { + cy.get(`[id$="${value}"]`).should('have.attr', 'aria-pressed', 'true'); + }); +});