Skip to content

Commit

Permalink
[test] Fix some flaky Cypress tests
Browse files Browse the repository at this point in the history
Signed-off-by: Florian ROUËNÉ <[email protected]>
  • Loading branch information
frouene committed Jun 18, 2024
1 parent 62d42d0 commit a056c38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 2 additions & 3 deletions integration-tests/cypress/e2e/project/diagrams/collapse.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ describe('Diagram - collapsible node', () => {
const studio = new Studio();
studio.createProjectFromDomain('Cypress - Studio Instance', domainName, 'Root').then((res) => {
instanceProjectId = res.projectId;

new Explorer().createRepresentation('Root', `${domainName} Diagram Description`, 'diagram');
});
});

Expand All @@ -84,12 +82,13 @@ describe('Diagram - collapsible node', () => {
explorer.createObject('Entity1', 'Relation Entity2');
explorer.select('Entity1');
details.getTextField('Name').type('Entity1{enter}');
explorer.createRepresentation('Root', `${domainName} Diagram Description`, 'diagram');
diagram.fitToScreen();
diagram
.getNodes('diagram', 'Entity1')
.findByTestId('Label - Entity1')
.should('have.css', 'border-bottom', '1px solid rgb(51, 176, 195)');
diagram.getNodes('diagram', 'Entity1').click('top');
diagram.getNodes('diagram', 'Entity1').findByTestId('Label - Entity1').click();
diagram.getPalette().should('exist');
diagram.getPalette().findByTestId('Collapse - Tool').click();
diagram
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ describe('Diagram - group palette', () => {
explorer.createObject('component', 'Packages Package');
details.getTextField('Name').invoke('text').should('eq', '');
details.getTextField('Name').type('package{enter}');
explorer.createObject('component', 'Packages Package');
details.getTextField('Name').invoke('text').should('eq', '');
details.getTextField('Name').type('package_bis{enter}');
explorer.createObject('package', 'Types Class');
details.getTextField('Name').invoke('text').should('eq', '');
details.getTextField('Name').type('class{enter}');
Expand All @@ -172,15 +175,15 @@ describe('Diagram - group palette', () => {
diagram.getGroupPalette().should('exist');
diagram.getGroupPalette().findByTestId('Align left').should('not.exist');
explorer.select('package');
explorer.select('class', true);
explorer.select('package_bis', true);
diagram.fitToScreen();
diagram.getNodes('diagram', 'class').click('top');
diagram.getNodes('diagram', 'package_bis').click();
diagram.getGroupPalette().should('exist');
diagram.getGroupPalette().findByTestId('Align left').should('exist');
explorer.select('attribute');
explorer.select('package', true);
diagram.fitToScreen();
diagram.getNodes('diagram', 'package').click('top');
diagram.getNodes('diagram', 'attribute').click();
diagram.getGroupPalette().should('exist');
diagram.getGroupPalette().findByTestId('Align left').should('not.exist');
});
Expand Down

0 comments on commit a056c38

Please sign in to comment.