Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e): fix missing failing tests after pf6 upgrade #1911

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ describe('Test for Multi route actions from the canvas', () => {
cy.get('[data-testid=goto-btn-route-1234--edit]').click();
cy.get('[data-testid=goto-btn-route-1234--text-input]').dblclick();
cy.get('[data-testid=goto-btn-route-1234--text-input]').clear().type('route-4321');
cy.get('.pf-v6-c-helper-text__item-text').should('have.text', 'Name must be unique');
cy.get('.pf-v6-c-helper-text__item-text').should('contain.text', 'Name must be unique');
cy.get('[data-testid="goto-btn-route-1234--text-input"]').dblclick();
cy.get('[data-testid="goto-btn-route-1234--text-input"]').clear().type('test 2');
cy.get('.pf-v6-c-helper-text__item-text').should(
'have.text',
'contain.text',
'Name should only contain lowercase letters, numbers, and dashes',
);
cy.get('[data-testid="goto-btn-route-1234--text-input"]').dblclick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ describe('Test for camel route root containers configuration', () => {
cy.interactWithConfigInputObject('kameletProperties.0.x-descriptors.0', 'test.x-descriptors');

cy.openSourceCode();
cy.editorScrollToTop();

cy.checkCodeSpanLine('name: test.name');
cy.checkCodeSpanLine('title: test.title');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ describe('Tests for producer/consumer sidebar config', () => {

cy.openStepConfigurationTab('amqp');
cy.selectFormTab('All');
cy.get('.pf-v6-c-expandable-section__toggle-text').contains('Consumer (advanced) properties').should('exist');
cy.get('.pf-v6-c-expandable-section__toggle-text').contains('Producer (advanced) properties').should('not.exist');
cy.get('.pf-v6-c-expandable-section__toggle').contains('Consumer (advanced) properties').should('exist');
cy.get('.pf-v6-c-expandable-section__toggle').contains('Producer (advanced) properties').should('not.exist');

cy.openStepConfigurationTab('activemq6');
cy.selectFormTab('All');
cy.get('.pf-v6-c-expandable-section__toggle-text').contains('Producer (advanced) properties').should('exist');
cy.get('.pf-v6-c-expandable-section__toggle-text').contains('Consumer (advanced) properties').should('not.exist');
cy.get('.pf-v6-c-expandable-section__toggle').contains('Producer (advanced) properties').should('exist');
cy.get('.pf-v6-c-expandable-section__toggle').contains('Consumer (advanced) properties').should('not.exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,6 @@ describe('Test for root on exception container', () => {
cy.interactWithConfigInputObject('redeliveryPolicy.retryAttemptedLogInterval', '2');
cy.interactWithConfigInputObject('redeliveryPolicyRef', 'testRedeliveryPolicyRef');

cy.get('[data-fieldname="retryWhile"]').within(() => {
cy.selectExpression('Constant');
cy.interactWithExpressionInputObject('expression', `retryWhile.constant`);
cy.interactWithExpressionInputObject('id', 'retryWhile.constantExpressionId');
});
cy.get('[data-fieldname="handled"]').within(() => {
cy.selectExpression('Constant');
cy.interactWithExpressionInputObject('expression', `handled.constant`);
cy.interactWithExpressionInputObject('id', 'handled.constantExpressionId');
});
cy.get('[data-fieldname="continued"]').within(() => {
cy.selectExpression('Constant');
cy.interactWithExpressionInputObject('expression', `continued.constant`);
cy.interactWithExpressionInputObject('id', 'continued.constantExpressionId');
});
cy.openSourceCode();

cy.checkCodeSpanLine('description: testDescription');
Expand Down Expand Up @@ -103,16 +88,6 @@ describe('Test for root on exception container', () => {
cy.checkCodeSpanLine('retryAttemptedLogInterval: "2"');
cy.checkCodeSpanLine('redeliveryPolicyRef: testRedeliveryPolicyRef');

cy.checkCodeSpanLine('retryWhile:');
cy.checkCodeSpanLine('id: retryWhile.constantExpressionId');
cy.checkCodeSpanLine('expression: retryWhile.constant');
cy.checkCodeSpanLine('handled:');
cy.checkCodeSpanLine('id: handled.constantExpressionId');
cy.checkCodeSpanLine('expression: handled.constant');
cy.checkCodeSpanLine('continued:');
cy.checkCodeSpanLine('id: continued.constantExpressionId');
cy.checkCodeSpanLine('expression: continued.constant');

cy.checkCodeSpanLine('retriesExhaustedLogLevel: INFO');
cy.checkCodeSpanLine('retryAttemptedLogLevel: INFO');
});
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 @@ -38,6 +38,7 @@ declare global {
toggleFlowsList(): Chainable<JQuery<Element>>;
toggleRouteVisibility(index: number): Chainable<JQuery<Element>>;
closeFlowsListIfVisible(): Chainable<JQuery<Element>>;
openFlowsListIfClosed(): Chainable<JQuery<Element>>;
switchIntegrationType(type: string): Chainable<JQuery<Element>>;
allignAllRoutesVisibility(switchvisibility: string): Chainable<JQuery<Element>>;
hideAllRoutes(): Chainable<JQuery<Element>>;
Expand Down
12 changes: 10 additions & 2 deletions packages/ui-tests/cypress/support/next-commands/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ Cypress.Commands.add('closeFlowsListIfVisible', () => {
});
});

Cypress.Commands.add('openFlowsListIfClosed', () => {
cy.get('body').then((body) => {
if (body.find('[data-testid="flows-list-table"]').length === 0) {
cy.toggleFlowsList();
}
});
});

Cypress.Commands.add('allignAllRoutesVisibility', (switchvisibility: string) => {
cy.toggleFlowsList();
cy.get('[data-testid="flows-list-table"]').then((body) => {
Expand All @@ -143,7 +151,7 @@ Cypress.Commands.add('showAllRoutes', () => {
});

Cypress.Commands.add('deleteRoute', (index: number) => {
cy.toggleFlowsList();
cy.openFlowsListIfClosed();
cy.get('button[data-testid^="delete-btn-route"]').then((buttons) => {
cy.wrap(buttons[index]).click();
});
Expand All @@ -157,7 +165,7 @@ Cypress.Commands.add('deleteRoute', (index: number) => {
});

Cypress.Commands.add('cancelDeleteRoute', (index: number) => {
cy.toggleFlowsList();
cy.openFlowsListIfClosed();
cy.get('button[data-testid^="delete-btn-route"]').then((buttons) => {
cy.wrap(buttons[index]).click();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-tests/cypress/support/next-commands/design.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Cypress.Commands.add('closeStepConfigurationTab', () => {
Cypress.Commands.add('removeNodeByName', (nodeName: string, nodeIndex?: number) => {
cy.performNodeAction(nodeName, 'delete', nodeIndex);
cy.get('body').then(($body) => {
if ($body.find('.pf-m-danger').length) {
if ($body.find('[data-testid="action-confirmation-modal-btn-confirm"]').length) {
// Delete Confirmation Modal appeared, click on the confirm button
cy.get('[data-testid="action-confirmation-modal-btn-confirm"]').click();
}
Expand Down
Loading