Skip to content

Commit e30fb71

Browse files
committed
Implement E2E test for deleting terminals
1 parent 2b4fdc7 commit e30fb71

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

cypress/e2e/map/editTerminals.cy.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,30 @@ describe('Terminals on map', mapViewport, () => {
240240
.should('not.have.value', '24.927445210156606');
241241
},
242242
);
243+
244+
it(
245+
'should delete terminal on map',
246+
{ tags: [Tag.Terminals, Tag.Map], scrollBehavior: 'bottom' },
247+
() => {
248+
mapModal.map.getTerminalById('T3').click();
249+
250+
mapModal.map.waitForLoadToComplete();
251+
252+
const { terminalPopup } = mapModal;
253+
254+
terminalPopup.getLabel().shouldBeVisible().shouldHaveText('T3 E2ET002');
255+
terminalPopup.getDeleteButton().click();
256+
257+
// Should list member stops on the confirmation dialog
258+
confirmationDialog.dialogWithButtons
259+
.getTextContent()
260+
.should('contain', 'E2E007');
261+
262+
confirmationDialog.getConfirmButton().click();
263+
expectGraphQLCallToSucceed('@gqlDeleteTerminal');
264+
265+
// Make sure that the terminal is not visible on the map
266+
mapModal.map.getTerminalById('T3').should('not.exist');
267+
},
268+
);
243269
});

cypress/pageObjects/ConfirmationDialog.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import { DialogWithButtons } from './DialogWithButtons';
2+
13
export class ConfirmationDialog {
4+
dialogWithButtons = new DialogWithButtons();
5+
26
getConfirmButton() {
37
return cy.getByTestId('ConfirmationDialog::confirmButton');
48
}

0 commit comments

Comments
 (0)