Skip to content

Commit

Permalink
e2e(1660): On Delete route - when user presses cancel, the route gets…
Browse files Browse the repository at this point in the history
… deleted
  • Loading branch information
tplevko committed Nov 26, 2024
1 parent e2b4778 commit f1da374
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ describe('Test for Multi route actions from the canvas', () => {

cy.get('[data-testid="flows-list-route-count"]').should('have.text', '3/3');

cy.cancelDeleteRoute(0);
cy.get('[data-testid="flows-list-route-count"]').should('have.text', '3/3');

cy.deleteRoute(0);
cy.deleteRoute(0);
cy.deleteRoute(0);
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 @@ -34,6 +34,7 @@ declare global {
openCatalog(): Chainable<JQuery<Element>>;
addNewRoute(): Chainable<JQuery<Element>>;
deleteRoute(index: number): Chainable<JQuery<Element>>;
cancelDeleteRoute(index: number): Chainable<JQuery<Element>>;
toggleFlowsList(): Chainable<JQuery<Element>>;
toggleRouteVisibility(index: number): Chainable<JQuery<Element>>;
closeFlowsListIfVisible(): Chainable<JQuery<Element>>;
Expand Down
13 changes: 13 additions & 0 deletions packages/ui-tests/cypress/support/next-commands/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,16 @@ Cypress.Commands.add('deleteRoute', (index: number) => {
});
cy.closeFlowsListIfVisible();
});

Cypress.Commands.add('cancelDeleteRoute', (index: number) => {
cy.toggleFlowsList();
cy.get('button[data-testid^="delete-btn-route"]').then((buttons) => {
cy.wrap(buttons[index]).click();
});
cy.get('body').then(($body) => {
if ($body.find('.pf-m-danger').length) {
cy.get('[data-testid="action-confirmation-modal-btn-cancel"]').click();
}
});
cy.closeFlowsListIfVisible();
});

0 comments on commit f1da374

Please sign in to comment.