Skip to content

Commit

Permalink
e2e - add side panel required filter field coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
tplevko authored and lordrip committed Aug 21, 2024
1 parent b5b069d commit 4b7dfa4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
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 @@ -82,6 +82,7 @@ declare global {
addSingleKVProperty(propertyName: string, key: string, value: string): Chainable<JQuery<Element>>;
filterFields(filter: string): Chainable<JQuery<Element>>;
selectFormTab(tab: string): Chainable<JQuery<Element>>;
specifiedFormTab(tab: string): Chainable<JQuery<Element>>;
// metadata
expandWrappedSection(sectionName: string): Chainable<JQuery<Element>>;
closeWrappedSection(sectionName: string): Chainable<JQuery<Element>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

0 comments on commit 4b7dfa4

Please sign in to comment.