wisemapping-frontend/packages/editor/cypress/e2e/relationship.cy.ts

37 lines
1.1 KiB
TypeScript
Raw Normal View History

context('Relationship Topics', () => {
2022-07-13 03:58:11 +02:00
beforeEach(() => {
2022-12-01 07:12:40 +01:00
// Remove storage for autosave ...
2022-07-13 03:58:11 +02:00
cy.visit('/editor.html');
2022-12-01 07:12:40 +01:00
cy.clearLocalStorage('welcome-xml');
2022-07-13 03:58:11 +02:00
cy.reload();
2022-12-01 07:12:40 +01:00
// Wait for load complate ...
cy.get('svg > path').should('be.visible');
2022-07-13 03:58:11 +02:00
});
2022-10-31 16:32:51 +01:00
it('Add Relationship', () => {
2022-12-07 03:05:25 +01:00
cy.contains('Features').click({ force: true });
cy.get(`[aria-label="Add Relationship"]`).click({ multiple: true });
2022-12-01 07:12:40 +01:00
cy.contains('Try it Now!').click();
2022-12-01 07:06:21 +01:00
2022-12-07 03:05:25 +01:00
cy.get('[test-id="11-15-relationship"]').click({ force: true });
2022-11-17 06:12:33 +01:00
cy.get('[test-id="11-15-relationship"]').should('exist');
2022-10-31 16:32:51 +01:00
cy.matchImageSnapshot('addRelationship');
});
2022-12-01 07:12:40 +01:00
it('Delete Relationship', () => {
2022-12-07 03:05:25 +01:00
cy.contains('Features').first().click({ force: true });
2022-11-17 06:12:33 +01:00
cy.get(`[aria-label="Add Relationship"]`).first().click();
cy.contains('Try it Now!').first().click();
2022-12-01 07:12:40 +01:00
cy.get('[test-id="11-15-relationship"]').should('exist');
2022-12-07 03:05:25 +01:00
cy.get('[test-id="11-15-relationship"]').click({ force: true });
2022-12-01 07:12:40 +01:00
2022-10-31 16:32:51 +01:00
cy.get('body').type('{backspace}');
2022-12-01 07:12:40 +01:00
cy.get('[test-id="11-15-relationship"]').should('not.exist');
2022-10-31 16:32:51 +01:00
cy.matchImageSnapshot('delete relationship');
2022-07-13 03:58:11 +02:00
});
});