From c712e341a063ca5b605d64d398f5c1f7e8787173 Mon Sep 17 00:00:00 2001 From: Denis Nikiforov Date: Fri, 26 Jul 2024 00:56:14 +1100 Subject: [PATCH] [3815] Make child creation descriptions locale independent Bug: https://github.com/eclipse-sirius/sirius-web/issues/3815 Signed-off-by: Denis Nikiforov --- CHANGELOG.adoc | 3 +- .../cypress/e2e/project/deck/deck.cy.ts | 2 +- .../cypress/e2e/project/details/form.cy.ts | 90 +++++++++---------- .../e2e/project/diagrams/collapse.cy.ts | 6 +- .../e2e/project/diagrams/custom-shape.cy.ts | 4 +- .../diagrams/diagram-contextual-palette.cy.js | 12 +-- .../e2e/project/diagrams/diagram-label.cy.ts | 6 +- .../project/diagrams/direct-edit-label.cy.ts | 18 ++-- .../cypress/e2e/project/diagrams/edges.cy.ts | 14 +-- .../e2e/project/diagrams/graphical-dnd.cy.ts | 14 +-- .../e2e/project/diagrams/group-palette.cy.ts | 12 +-- .../e2e/project/diagrams/list-node.cy.ts | 2 +- .../project/diagrams/node-aspect-ratio.cy.ts | 16 ++-- .../explorer/document-context-menu.cy.js | 2 +- .../explorer/object-context-menu.cy.js | 4 +- .../formdescriptioneditor.cy.js | 34 +++---- .../e2e/project/forms/widget-reference.cy.ts | 46 +++++----- .../e2e/project/studio/color-palette.cy.js | 6 +- .../cypress/e2e/project/studio/studio.cy.ts | 72 ++++++++++----- integration-tests/cypress/workbench/Deck.ts | 6 +- .../emf/services/DefaultEditService.java | 31 +++---- ...ectCreationControllerIntegrationTests.java | 4 +- 22 files changed, 216 insertions(+), 188 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a43163b6ed..5667a143a6 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -52,7 +52,8 @@ As a result, the following maven modules have been deleted: `sirius-web-sample-a * The `String` attribute `org.eclipse.sirius.components.collaborative.diagrams.dto.InvokeSingleClickOnDiagramElementToolInput#selectedObjectId` has been replaced by the attribute `variables` of type `List` - https://github.com/eclipse-sirius/sirius-web/issues/3437[#3437] [core] Migrate frontend to MUI 5, if you contributed React componenent that use MUI, you should upgrade them to use MUI 5. -- https://github.com/eclipse-sirius/sirius-web/issues/2204[#2204] [core, tree] Added `getStyledLabel` in `IDefaultLabelService` and `IObjectService`, you must implement this method if you have custom implementation of these interface. +- https://github.com/eclipse-sirius/sirius-web/issues/2204[#2204] [core] Added `getStyledLabel` in `IDefaultLabelService` and `IObjectService`, you must implement this method if you have custom implementation of these interface. +- https://github.com/eclipse-sirius/sirius-web/issues/3815[#3815] [core] Make child creation descriptions locale independent === Dependency update diff --git a/integration-tests/cypress/e2e/project/deck/deck.cy.ts b/integration-tests/cypress/e2e/project/deck/deck.cy.ts index bddc61ecd1..e696798bae 100644 --- a/integration-tests/cypress/e2e/project/deck/deck.cy.ts +++ b/integration-tests/cypress/e2e/project/deck/deck.cy.ts @@ -115,7 +115,7 @@ describe('Verify the Deck Representation', () => { }); it('We create a new daily tag to verify that the deck is properly refreshed', () => { const explorer = new Explorer(); - explorer.createObject('Daily Project Dev', 'Tag'); + explorer.createObject('Daily Project Dev', 'ownedTags-TaskTag'); explorer.select('::'); const details = new Details(); details.getTextField('Prefix').type('daily{enter}'); diff --git a/integration-tests/cypress/e2e/project/details/form.cy.ts b/integration-tests/cypress/e2e/project/details/form.cy.ts index 002537e909..4efc1d47fc 100644 --- a/integration-tests/cypress/e2e/project/details/form.cy.ts +++ b/integration-tests/cypress/e2e/project/details/form.cy.ts @@ -11,47 +11,47 @@ * Obeo - initial API and implementation *******************************************************************************/ -import { Project } from "../../../pages/Project"; -import { Flow } from "../../../usecases/Flow"; -import { Studio } from "../../../usecases/Studio"; -import { Details } from "../../../workbench/Details"; -import { Explorer } from "../../../workbench/Explorer"; +import { Project } from '../../../pages/Project'; +import { Flow } from '../../../usecases/Flow'; +import { Studio } from '../../../usecases/Studio'; +import { Details } from '../../../workbench/Details'; +import { Explorer } from '../../../workbench/Explorer'; describe('/projects/:projectId/edit - Form', () => { context('Given a Form Description', () => { let studioProjectId: string = ''; before(() => - new Studio().createBlankStudioProjectWithView().then((createdProjectData) => { - studioProjectId = createdProjectData.projectId; - new Project().visit(createdProjectData.projectId); - const explorer = new Explorer(); - explorer.expand('ViewDocument'); - explorer.expand('View'); - explorer.createObject('View', 'Form Description'); - explorer.select('New Form Description'); - const details = new Details(); - details.getTextField('Domain Type').type('flow::System'); - details.getTextField('Name').type('{selectall}').type('ReadOnlyRepresentation'); - details.getTextField('Title Expression').type('{selectall}').type('ReadOnlyRepresentation'); - explorer.expand('ReadOnlyRepresentation'); - explorer.expand('PageDescription'); - explorer.select('GroupDescription') - details.getTextField('Name').type('Group ReadOnly{enter}'); - explorer.createObject('Group ReadOnly', 'Widgets Button Description'); - details.getTextField('Button Label Expression').type('Test Button'); - details.getTextField('Is Enabled Expression').type('aql:self.temperature==0'); - explorer.createObject('Group ReadOnly', 'Widgets Flexbox Container Description'); - details.getTextField('Name').invoke('text').should('eq', ''); - details.getTextField('Name').type('Flexbox Container'); - details.getTextField('Label Expression').type('Test flexbox container'); - details.getTextField('Is Enabled Expression').type("aql:self.name='NewSystem'"); + new Studio().createBlankStudioProjectWithView().then((createdProjectData) => { + studioProjectId = createdProjectData.projectId; + new Project().visit(createdProjectData.projectId); + const explorer = new Explorer(); + explorer.expand('ViewDocument'); + explorer.expand('View'); + explorer.createObject('View', 'descriptions-FormDescription'); + explorer.select('New Form Description'); + const details = new Details(); + details.getTextField('Domain Type').type('flow::System'); + details.getTextField('Name').type('{selectall}').type('ReadOnlyRepresentation'); + details.getTextField('Title Expression').type('{selectall}').type('ReadOnlyRepresentation'); + explorer.expand('ReadOnlyRepresentation'); + explorer.expand('Page Description'); + explorer.select('Group Description'); + details.getTextField('Name').type('Group ReadOnly{enter}'); + explorer.createObject('Group ReadOnly', 'children-ButtonDescription'); + details.getTextField('Button Label Expression').type('Test Button'); + details.getTextField('Is Enabled Expression').type('aql:self.temperature==0'); + explorer.createObject('Group ReadOnly', 'children-FlexboxContainerDescription'); + details.getTextField('Name').invoke('text').should('eq', ''); + details.getTextField('Name').type('Flexbox Container'); + details.getTextField('Label Expression').type('Test flexbox container'); + details.getTextField('Is Enabled Expression').type("aql:self.name='NewSystem'"); - explorer.createObject('Flexbox Container', 'Textfield Description'); - details.getTextField('Name').invoke('text').should('eq', ''); - details.getTextField('Label Expression').type('Name'); - details.getTextField('Value Expression').type('aql:self.name'); - }) + explorer.createObject('Flexbox Container', 'children-TextfieldDescription'); + details.getTextField('Name').invoke('text').should('eq', ''); + details.getTextField('Label Expression').type('Name'); + details.getTextField('Value Expression').type('aql:self.name'); + }) ); after(() => cy.deleteProject(studioProjectId)); @@ -68,16 +68,16 @@ describe('/projects/:projectId/edit - Form', () => { afterEach(() => cy.deleteProject(flowProjectId)); it('check widget read-only mode in form', () => { - const explorer = new Explorer(); - explorer.expand('FlowNewModel'); - explorer.createRepresentation('NewSystem', 'ReadOnlyRepresentation', 'ReadOnlyRepresentation'); - cy.getByTestId('Test Button').should('exist').should('not.be.disabled'); - explorer.select('NewSystem'); - const details = new Details(); - details.getTextField('Temperature').type('{selectall}2{enter}'); - cy.getByTestId('Test Button').should('be.disabled'); - details.getTextField('Temperature').type('{selectall}0{enter}'); - cy.getByTestId('Test Button').should('not.be.disabled'); + const explorer = new Explorer(); + explorer.expand('FlowNewModel'); + explorer.createRepresentation('NewSystem', 'ReadOnlyRepresentation', 'ReadOnlyRepresentation'); + cy.getByTestId('Test Button').should('exist').should('not.be.disabled'); + explorer.select('NewSystem'); + const details = new Details(); + details.getTextField('Temperature').type('{selectall}2{enter}'); + cy.getByTestId('Test Button').should('be.disabled'); + details.getTextField('Temperature').type('{selectall}0{enter}'); + cy.getByTestId('Test Button').should('not.be.disabled'); }); it('check the flexbox read-only mode is dispatched to children', () => { @@ -90,7 +90,5 @@ describe('/projects/:projectId/edit - Form', () => { cy.getByTestId('page').findByTestId('input-Name').should('be.disabled'); }); }); - - }); }); diff --git a/integration-tests/cypress/e2e/project/diagrams/collapse.cy.ts b/integration-tests/cypress/e2e/project/diagrams/collapse.cy.ts index 1950f3e925..4d65c3a665 100644 --- a/integration-tests/cypress/e2e/project/diagrams/collapse.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/collapse.cy.ts @@ -40,7 +40,7 @@ describe('Diagram - collapsible node', () => { cy.get('[title="domain::Domain"]').then(($div) => { domainName = $div.data().testid; explorer.expand(domainName); - explorer.createObject('Entity1', 'Relation'); + explorer.createObject('Entity1', 'relations-Relation'); details.getCheckBox('Containment').check(); details.openReferenceWidgetOptions('Target Type'); details.selectReferenceWidgetOption('Entity2'); @@ -78,8 +78,8 @@ describe('Diagram - collapsible node', () => { const explorer = new Explorer(); const diagram = new Diagram(); const details = new Details(); - explorer.createObject('Root', 'Entity1s Entity1'); - explorer.createObject('Entity1', 'Relation Entity2'); + explorer.createObject('Root', 'entity1s-Entity1'); + explorer.createObject('Entity1', 'relation-Entity2'); explorer.select('Entity1'); details.getTextField('Name').type('Entity1{enter}'); explorer.createRepresentation('Root', `${domainName} Diagram Description`, 'diagram'); diff --git a/integration-tests/cypress/e2e/project/diagrams/custom-shape.cy.ts b/integration-tests/cypress/e2e/project/diagrams/custom-shape.cy.ts index 5c91b9abed..e6342b0c89 100644 --- a/integration-tests/cypress/e2e/project/diagrams/custom-shape.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/custom-shape.cy.ts @@ -36,7 +36,7 @@ describe('/projects/:projectId/edit - Custom Shape', () => { cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); cy.getByTestId('childCreationDescription') - .get('[data-value="Ellipse Node Style Description"]') + .get('[data-value="style-EllipseNodeStyleDescription"]') .should('exist') .click(); cy.getByTestId('create-object').click(); @@ -77,7 +77,7 @@ describe('/projects/:projectId/edit - Custom Shape', () => { cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Entity1s Entity1"]').should('exist').click(); + cy.getByTestId('childCreationDescription').get('[data-value="entity1s-Entity1"]').should('exist').click(); cy.getByTestId('create-object').click(); cy.getByTestId('Ellipse - ').should('have.css', 'border-radius', '50%'); diff --git a/integration-tests/cypress/e2e/project/diagrams/diagram-contextual-palette.cy.js b/integration-tests/cypress/e2e/project/diagrams/diagram-contextual-palette.cy.js index f35870e488..b10d28fa98 100644 --- a/integration-tests/cypress/e2e/project/diagrams/diagram-contextual-palette.cy.js +++ b/integration-tests/cypress/e2e/project/diagrams/diagram-contextual-palette.cy.js @@ -106,22 +106,22 @@ describe('/projects/:projectId/edit - Robot Diagram', () => { cy.getByTestId('treeitem-contextmenu').findByTestId('rename-tree-item').click(); cy.getByTestId('name-edit').type('Diagram Description{enter}'); - cy.createChildObject('DiagramPalette', 'Diagram Tool Section'); + cy.createChildObject('Palette', 'toolSections-DiagramToolSection'); cy.getByTestId('Tool Section').click(); cy.getByTestId('Name').type('{selectAll}section1'); - cy.createChildObject('DiagramPalette', 'Diagram Tool Section'); + cy.createChildObject('Palette', 'toolSections-DiagramToolSection'); cy.getByTestId('Tool Section').click(); cy.getByTestId('Name').type('{selectAll}section2'); - cy.createChildObject('section1', 'Node Tool'); + cy.createChildObject('section1', 'nodeTools-NodeTool'); cy.getByTestId('Tool').click(); cy.getByTestId('Name').type('{selectAll}tool1_section1'); - cy.createChildObject('section1', 'Node Tool'); + cy.createChildObject('section1', 'nodeTools-NodeTool'); cy.getByTestId('Tool').click(); cy.getByTestId('Name').type('{selectAll}tool2_section1'); - cy.createChildObject('section2', 'Node Tool'); + cy.createChildObject('section2', 'nodeTools-NodeTool'); cy.getByTestId('Tool').click(); cy.getByTestId('Name').type('{selectAll}tool1_section2'); - cy.createChildObject('section2', 'Node Tool'); + cy.createChildObject('section2', 'nodeTools-NodeTool'); cy.getByTestId('Tool').click(); cy.getByTestId('Name').type('{selectAll}tool2_section2'); diff --git a/integration-tests/cypress/e2e/project/diagrams/diagram-label.cy.ts b/integration-tests/cypress/e2e/project/diagrams/diagram-label.cy.ts index 5877e73d39..021e99ff75 100644 --- a/integration-tests/cypress/e2e/project/diagrams/diagram-label.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/diagram-label.cy.ts @@ -45,18 +45,18 @@ describe('Diagram - inside outside labels', () => { explorer.expand('Entity1 Node'); explorer.select('aql:self.name'); details.getTextField('Label Expression').type('{selectAll}InsideLabelNode1{enter}'); - explorer.createObject('Entity1 Node', 'Outside Label Description'); + explorer.createObject('Entity1 Node', 'outsideLabels-OutsideLabelDescription'); explorer.select('aql:self.name'); details.getTextField('Label Expression').type('{selectAll}OutsideLabelNode1{enter}'); explorer.collapse('Entity1 Node'); explorer.expand('Entity2 Node'); explorer.select('aql:self.name'); details.getTextField('Label Expression').type('{selectAll}InsideLabelNode2{enter}'); - explorer.createObject('Entity2 Node', 'Outside Label Description'); + explorer.createObject('Entity2 Node', 'outsideLabels-OutsideLabelDescription'); explorer.select('aql:self.name'); details.getTextField('Label Expression').type('{selectAll}OutsideLabelNode2{enter}'); explorer.delete('RectangularNodeStyleDescription'); - explorer.createObject('Entity2 Node', 'Style Image'); + explorer.createObject('Entity2 Node', 'style-ImageNodeStyleDescription'); details.selectValue('Shape', 'camera'); }); } diff --git a/integration-tests/cypress/e2e/project/diagrams/direct-edit-label.cy.ts b/integration-tests/cypress/e2e/project/diagrams/direct-edit-label.cy.ts index 25a531bab0..8a3f7a4a0b 100644 --- a/integration-tests/cypress/e2e/project/diagrams/direct-edit-label.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/direct-edit-label.cy.ts @@ -69,7 +69,7 @@ describe('Diagram - Direct edit label', () => { it('Then we cannot perform the direct edition of the node without the direct edit tool', () => { const explorer = new Explorer(); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); explorer.getTreeItemByLabel('Entity1').click(); const details = new Details(); @@ -87,7 +87,7 @@ describe('Diagram - Direct edit label', () => { it('Then we can perform the edition of the label of the node with the direct edit tool', () => { const explorer = new Explorer(); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity2s-Entity2'); explorer.getTreeItemByLabel('Entity2').click(); const details = new Details(); @@ -105,7 +105,7 @@ describe('Diagram - Direct edit label', () => { it('Then during edit triggering escape cancelled the current edition', () => { const explorer = new Explorer(); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity2s-Entity2'); explorer.getTreeItemByLabel('Entity2').click(); const details = new Details(); @@ -124,7 +124,7 @@ describe('Diagram - Direct edit label', () => { it('Then we can set the correct name when typing directly', () => { const explorer = new Explorer(); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity2s-Entity2'); const details = new Details(); details.getTextField('Name').type('Entity2{Enter}'); @@ -135,8 +135,8 @@ describe('Diagram - Direct edit label', () => { it('Then we can use direct edit on edge', () => { const explorer = new Explorer(); - explorer.createObject('Root', 'Entity1s Entity1'); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity1s-Entity1'); + explorer.createObject('Root', 'entity2s-Entity2'); explorer.select('Entity2'); const details = new Details(); details.getTextField('Name').type('Entity2'); @@ -155,7 +155,7 @@ describe('Diagram - Direct edit label', () => { it('Then during the direct edition, the palette is hidden', () => { const explorer = new Explorer(); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity2s-Entity2'); explorer.getTreeItemByLabel('Entity2').click(); const details = new Details(); @@ -223,8 +223,8 @@ describe('Diagram - Direct edit label', () => { it('Then we can not use direct edit on edge', () => { const explorer = new Explorer(); - explorer.createObject('Root', 'Entity1s Entity1'); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity1s-Entity1'); + explorer.createObject('Root', 'entity2s-Entity2'); explorer.select('Entity2'); const details = new Details(); details.getTextField('Name').type('Entity2'); diff --git a/integration-tests/cypress/e2e/project/diagrams/edges.cy.ts b/integration-tests/cypress/e2e/project/diagrams/edges.cy.ts index 38867addd2..6cc5ade2af 100644 --- a/integration-tests/cypress/e2e/project/diagrams/edges.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/edges.cy.ts @@ -30,7 +30,7 @@ describe('Diagram - edges', () => { cy.get('[title="domain::Domain"]').then(($div) => { domainName = $div.data().testid; explorer.expand(`${domainName}`); - explorer.createObject('Entity1', 'Relation'); + explorer.createObject('Entity1', 'relations-Relation'); const details = new Details(); details.getCheckBox('Containment').check(); details.openReferenceWidgetOptions('Target Type'); @@ -67,9 +67,9 @@ describe('Diagram - edges', () => { const details = new Details(); const diagram = new Diagram(); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); details.getTextField('Name').type('Entity1{Enter}'); - explorer.createObject('Entity1', 'Relation Entity2'); + explorer.createObject('Entity1', 'relation-Entity2'); details.getTextField('Name').should('have.value', ''); details.getTextField('Name').type('Entity2{Enter}'); @@ -111,7 +111,7 @@ describe('Diagram - edges', () => { details.getTextField('Default Width Expression').type('300{enter}'); details.getTextField('Default Height Expression').type('50{enter}'); explorer.delete('RectangularNodeStyleDescription'); - explorer.createObject('Entity1 Node', 'Ellipse Node Style Description'); + explorer.createObject('Entity1 Node', 'style-EllipseNodeStyleDescription'); }); }) ); @@ -135,12 +135,12 @@ describe('Diagram - edges', () => { const details = new Details(); const diagram = new Diagram(); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); details.getTextField('Name').type('Entity1{Enter}'); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity2s-Entity2'); details.getTextField('Name').should('have.value', ''); details.getTextField('Name').type('Entity2{Enter}'); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity2s-Entity2'); details.getTextField('Name').should('have.value', ''); details.getTextField('Name').type('Entity2.bis{Enter}'); explorer.select('Entity1'); diff --git a/integration-tests/cypress/e2e/project/diagrams/graphical-dnd.cy.ts b/integration-tests/cypress/e2e/project/diagrams/graphical-dnd.cy.ts index 785323c4e0..dbd4c59e35 100644 --- a/integration-tests/cypress/e2e/project/diagrams/graphical-dnd.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/graphical-dnd.cy.ts @@ -42,7 +42,7 @@ describe('Diagram - Graphical-dnd', () => { it.skip('Check graphical Drag and Drop', () => { const explorer = new Explorer(); - explorer.createObject('Entity2', 'Relation'); + explorer.createObject('Entity2', 'relations-Relation'); const details = new Details(); details.getCheckBox('Containment').check(); details.openReferenceWidgetOptions('Target Type'); @@ -54,14 +54,14 @@ describe('Diagram - Graphical-dnd', () => { explorer.expand('Entity2 Node'); details.openReferenceWidgetOptions('Reused Child Node Descriptions'); details.selectReferenceWidgetOption('Entity1 Node'); - explorer.createObject('NodePalette', 'Drop Node Tool'); + explorer.createObject('NodePalette', 'dropNodeTool-DropNodeTool'); explorer.select('Tool'); details.getTextField('Name').type('{selectAll}Drop Entity1 Tool{Enter}'); details.openReferenceWidgetOptions('Accepted Node Types'); details.selectReferenceWidgetOption('Entity1 Node'); - explorer.createObject('Drop Entity1 Tool', 'Change Context'); + explorer.createObject('Drop Entity1 Tool', 'body-ChangeContext'); details.getTextField('Expression').type('{selectAll}aql:targetElement{enter}'); - explorer.createObject('aql:targetElement', 'Set Value'); + explorer.createObject('aql:targetElement', 'children-SetValue'); details.getTextField('Feature Name').type('relation{Enter}'); details.getTextField('Value Expression').type('aql:droppedElement{Enter}'); @@ -71,16 +71,16 @@ describe('Diagram - Graphical-dnd', () => { new Explorer().createRepresentation('Root', `${domainName} Diagram Description`, 'diagram'); }); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); details.getTextField('Name').type('Entity1{Enter}'); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity2s-Entity2'); details.getTextField('Name').type('Entity2{Enter}'); const diagram = new Diagram(); diagram.dragAndDropNode('Rectangle - Entity1', 'Rectangle - Entity2'); diagram.isNodeInside('Rectangle - Entity1', 'Rectangle - Entity2'); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); details.getTextField('Name').type('InvalidTarget{Enter}'); diagram.dragAndDropNode('Rectangle - Entity1', 'Rectangle - InvalidTarget'); diff --git a/integration-tests/cypress/e2e/project/diagrams/group-palette.cy.ts b/integration-tests/cypress/e2e/project/diagrams/group-palette.cy.ts index 6e722666aa..bf8fac4948 100644 --- a/integration-tests/cypress/e2e/project/diagrams/group-palette.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/group-palette.cy.ts @@ -143,22 +143,22 @@ describe('Diagram - group palette', () => { const explorer = new Explorer(); const details = new Details(); const diagram = new Diagram(); - explorer.createObject('Root', 'Components Component'); + explorer.createObject('Root', 'components-Component'); details.getTextField('Name').invoke('text').should('eq', ''); details.getTextField('Name').type('component{enter}'); - explorer.createObject('component', 'Packages Package'); + explorer.createObject('component', 'packages-Package'); details.getTextField('Name').invoke('text').should('eq', ''); details.getTextField('Name').type('package{enter}'); - explorer.createObject('component', 'Packages Package'); + explorer.createObject('component', 'packages-Package'); details.getTextField('Name').invoke('text').should('eq', ''); details.getTextField('Name').type('package_bis{enter}'); - explorer.createObject('package', 'Types Class'); + explorer.createObject('package', 'types-Class'); details.getTextField('Name').invoke('text').should('eq', ''); details.getTextField('Name').type('class{enter}'); - explorer.createObject('class', 'Attributes Attribute'); + explorer.createObject('class', 'attributes-Attribute'); details.getTextField('Name').invoke('text').should('eq', ''); details.getTextField('Name').type('attribute{enter}'); - explorer.createObject('class', 'Operations Operation'); + explorer.createObject('class', 'operations-Operation'); details.getTextField('Name').invoke('text').should('eq', ''); details.getTextField('Name').type('operation{enter}'); explorer.createRepresentation('Root', 'Diagram', 'diagram'); diff --git a/integration-tests/cypress/e2e/project/diagrams/list-node.cy.ts b/integration-tests/cypress/e2e/project/diagrams/list-node.cy.ts index b6d5f29dcb..7196d51205 100644 --- a/integration-tests/cypress/e2e/project/diagrams/list-node.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/list-node.cy.ts @@ -35,7 +35,7 @@ describe('List-node', () => { explorer.expand(`${domainName} Diagram Description`); }); explorer.expand('Entity1 Node'); - explorer.createObject('Entity1 Node', 'Layout List'); + explorer.createObject('Entity1 Node', 'childrenLayoutStrategy-ListLayoutStrategyDescription'); }) ); diff --git a/integration-tests/cypress/e2e/project/diagrams/node-aspect-ratio.cy.ts b/integration-tests/cypress/e2e/project/diagrams/node-aspect-ratio.cy.ts index ac55fcc2bf..b07b65a95d 100644 --- a/integration-tests/cypress/e2e/project/diagrams/node-aspect-ratio.cy.ts +++ b/integration-tests/cypress/e2e/project/diagrams/node-aspect-ratio.cy.ts @@ -56,7 +56,7 @@ describe('Diagram - Node aspect ratio', () => { instanceProjectId = res.projectId; }); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); explorer.select('Entity1'); details.getTextField('Name').type('Node{enter}'); @@ -89,10 +89,10 @@ describe('Diagram - Node aspect ratio', () => { const explorer = new Explorer(); const details = new Details(); - explorer.createObject(domainName, 'Entity'); + explorer.createObject(domainName, 'types-Entity'); details.getTextField('Name').should('have.value', 'NewEntity'); details.getTextField('Name').clear().type('SubNode{enter}'); - explorer.createObject('Entity1', 'Relation'); + explorer.createObject('Entity1', 'relations-Relation'); details.getCheckBox('Containment').check(); details.openReferenceWidgetOptions('Target Type'); details.selectReferenceWidgetOption('SubNode'); @@ -101,7 +101,7 @@ describe('Diagram - Node aspect ratio', () => { explorer.expand('View'); explorer.expand(`${domainName} Diagram Description`); - explorer.createObject(`${domainName} Diagram Description`, 'Node Description'); + explorer.createObject(`${domainName} Diagram Description`, 'nodeDescriptions-NodeDescription'); details.getTextField('Domain Type').should('have.value', ''); details.getTextField('Domain Type').type(`${domainName}::SubNode`); @@ -128,11 +128,11 @@ describe('Diagram - Node aspect ratio', () => { instanceProjectId = res.projectId; }); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); explorer.select('Entity1'); details.getTextField('Name').type('Node{enter}'); - explorer.createObject('Node', 'Relation Sub Node'); + explorer.createObject('Node', 'relation-SubNode'); explorer.createRepresentation('Root', `${domainName} Diagram Description`, 'diagram'); @@ -156,11 +156,11 @@ describe('Diagram - Node aspect ratio', () => { instanceProjectId = res.projectId; }); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); explorer.select('Entity1'); details.getTextField('Name').type('Node{enter}'); - explorer.createObject('Node', 'Relation Sub Node'); + explorer.createObject('Node', 'relation-SubNode'); explorer.createRepresentation('Root', `${domainName} Diagram Description`, 'diagram'); diff --git a/integration-tests/cypress/e2e/project/explorer/document-context-menu.cy.js b/integration-tests/cypress/e2e/project/explorer/document-context-menu.cy.js index cb58ad9c30..c94964952e 100644 --- a/integration-tests/cypress/e2e/project/explorer/document-context-menu.cy.js +++ b/integration-tests/cypress/e2e/project/explorer/document-context-menu.cy.js @@ -108,7 +108,7 @@ describe('/projects/:projectId/edit - Document Context Menu', () => { cy.getByTestId('suggested').click({ force: true }); cy.getByTestId('type').click(); - cy.get('[data-value="Entity"]').click(); + cy.get('[data-value="types-Entity"]').click(); cy.getByTestId('create-object').click(); diff --git a/integration-tests/cypress/e2e/project/explorer/object-context-menu.cy.js b/integration-tests/cypress/e2e/project/explorer/object-context-menu.cy.js index 0269d4c23e..6408ff339a 100644 --- a/integration-tests/cypress/e2e/project/explorer/object-context-menu.cy.js +++ b/integration-tests/cypress/e2e/project/explorer/object-context-menu.cy.js @@ -81,7 +81,7 @@ describe('/projects/:projectId/edit - Object Context Menu', () => { cy.getByTestId('create-object').should('be.enabled'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Power Input"]').click(); + cy.get('[data-value="powerInputs-PowerInput"]').click(); cy.getByTestId('create-object').click(); cy.getByTestId('explorer://').contains('PowerInput'); @@ -96,7 +96,7 @@ describe('/projects/:projectId/edit - Object Context Menu', () => { cy.getByTestId('create-object').should('be.enabled'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Power Input"]').click(); + cy.get('[data-value="powerInputs-PowerInput"]').click(); cy.getByTestId('create-object').click(); cy.getByTestId('explorer://').contains('PowerInput'); diff --git a/integration-tests/cypress/e2e/project/formdescriptioneditor/formdescriptioneditor.cy.js b/integration-tests/cypress/e2e/project/formdescriptioneditor/formdescriptioneditor.cy.js index 7dc0a20567..029eda9fe4 100644 --- a/integration-tests/cypress/e2e/project/formdescriptioneditor/formdescriptioneditor.cy.js +++ b/integration-tests/cypress/e2e/project/formdescriptioneditor/formdescriptioneditor.cy.js @@ -31,7 +31,7 @@ describe('/projects/:projectId/edit - FormDescriptionEditor', () => { //make sure the data are fetched before selecting cy.getByTestId('create-object').should('be.enabled'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Form Description"]').click(); + cy.get('[data-value="descriptions-FormDescription"]').click(); cy.getByTestId('create-object').click(); // create the form description editor cy.getByTestId('New Form Description').click(); @@ -140,7 +140,7 @@ describe('/projects/:projectId/edit - FormDescriptionEditor', () => { cy.getByTestId('New Form Description-more').should('be.enabled').click(); cy.getByTestId('treeitem-contextmenu').findByTestId('new-object').click(); cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); - cy.getByTestId('childCreationDescription').click().get('[data-value="Page Description"]').should('exist').click(); + cy.getByTestId('childCreationDescription').click().get('[data-value="pages-PageDescription"]').should('exist').click(); cy.getByTestId('create-object').click(); // Adds a widget to the first page cy.getByTestId('PageDescription').eq(0).dblclick(); @@ -150,7 +150,7 @@ describe('/projects/:projectId/edit - FormDescriptionEditor', () => { cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); cy.getByTestId('childCreationDescription') .click() - .get('[data-value="Widgets Pie Chart Description"]') + .get('[data-value="children-PieChartDescription"]') .should('exist') .click(); cy.getByTestId('create-object').click(); @@ -162,7 +162,7 @@ describe('/projects/:projectId/edit - FormDescriptionEditor', () => { cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); cy.getByTestId('childCreationDescription') .click() - .get('[data-value="Widgets Bar Chart Description"]') + .get('[data-value="children-BarChartDescription"]') .should('exist') .click(); cy.getByTestId('create-object').click(); @@ -208,9 +208,9 @@ describe('/projects/:projectId/edit - FormDescriptionEditor', () => { cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); cy.getByTestId('childCreationDescription') .click() - .get('[data-value="Conditional Styles Conditional Reference Widget Description Style"]') + .get('[data-value="conditionalStyles-ConditionalReferenceWidgetDescriptionStyle"]') .should('exist'); - cy.get('[data-value="Style Widget Description Style"]').should('exist').click(); + cy.get('[data-value="style-ReferenceWidgetDescriptionStyle"]').should('exist').click(); cy.getByTestId('create-object').click(); cy.getByTestId('Font Size').should('exist'); cy.getByTestId('Italic').should('exist'); @@ -251,15 +251,15 @@ describe('/projects/:projectId/edit - FormDescriptionEditor', () => { it('is enabled expression is available only for the editable widgets', () => { cy.getByTestId('PageDescription').dblclick(); // Not editable widgets shouldn't have isEnabledExpression - checkWidgetIsEnabledExpression('Widgets Link', 'not.exist'); - checkWidgetIsEnabledExpression('Widgets Pie Chart', 'not.exist'); - checkWidgetIsEnabledExpression('Widgets Label', 'not.exist'); + checkWidgetIsEnabledExpression('children-LinkDescription', 'not.exist'); + checkWidgetIsEnabledExpression('children-PieChartDescription', 'not.exist'); + checkWidgetIsEnabledExpression('children-LabelDescription', 'not.exist'); // Editable widgets should have isEnabledExpression - checkWidgetIsEnabledExpression('Widgets Button', 'exist'); - checkWidgetIsEnabledExpression('Widgets Flexbox Container', 'exist'); - checkWidgetIsEnabledExpression('Toolbar Actions Button', 'exist'); - checkWidgetIsEnabledExpression('Widgets Slider', 'exist'); + checkWidgetIsEnabledExpression('children-ButtonDescription', 'exist'); + checkWidgetIsEnabledExpression('children-FlexboxContainerDescription', 'exist'); + checkWidgetIsEnabledExpression('toolbarActions-ButtonDescription', 'exist'); + checkWidgetIsEnabledExpression('children-SliderDescription', 'exist'); }); function createBorderStyleAndCheckProperties(styleName) { @@ -282,10 +282,10 @@ describe('/projects/:projectId/edit - FormDescriptionEditor', () => { it('can create border style in a Group', () => { cy.getByTestId('PageDescription').dblclick(); cy.getByTestId('GroupDescription-more').should('be.enabled').click(); - createBorderStyleAndCheckProperties('Border Style Container Border Style'); + createBorderStyleAndCheckProperties('borderStyle-ContainerBorderStyle'); cy.getByTestId('GroupDescription-more').should('be.enabled').click(); - createBorderStyleAndCheckProperties('Conditional Border Styles Conditional Container Border Style'); + createBorderStyleAndCheckProperties('conditionalBorderStyles-ConditionalContainerBorderStyle'); cy.getByTestId('Condition').should('exist'); }); @@ -300,10 +300,10 @@ describe('/projects/:projectId/edit - FormDescriptionEditor', () => { cy.getByTestId('GroupDescription').dblclick(); cy.getByTestId('FlexboxContainerDescription-more').click(); - createBorderStyleAndCheckProperties('Border Style Container Border Style'); + createBorderStyleAndCheckProperties('borderStyle-ContainerBorderStyle'); cy.getByTestId('FlexboxContainerDescription-more').click(); - createBorderStyleAndCheckProperties('Conditional Border Styles Conditional Container Border Style'); + createBorderStyleAndCheckProperties('conditionalBorderStyles-ConditionalContainerBorderStyle'); cy.getByTestId('Condition').should('exist'); }); diff --git a/integration-tests/cypress/e2e/project/forms/widget-reference.cy.ts b/integration-tests/cypress/e2e/project/forms/widget-reference.cy.ts index 4f06c6cab2..0485d4f5c3 100644 --- a/integration-tests/cypress/e2e/project/forms/widget-reference.cy.ts +++ b/integration-tests/cypress/e2e/project/forms/widget-reference.cy.ts @@ -22,14 +22,14 @@ import { Form } from '../../../workbench/Form'; const createFormWithWidgetRef = (domainType: string, name: string, reference: string) => { const explorer = new Explorer(); const details = new Details(); - explorer.createObject('View', 'Form Description'); + explorer.createObject('View', 'descriptions-FormDescription'); explorer.select('New Form Description'); details.getTextField('Domain Type').type(domainType); details.getTextField('Name').type(`{selectall}${name}{enter}`); details.getTextField('Title Expression').type(`{selectall}${name}{enter}`); explorer.expand(name); explorer.expand('PageDescription'); - explorer.createObject('GroupDescription', 'Widgets Reference Widget Description'); + explorer.createObject('Group Description', 'children-ReferenceWidgetDescription'); details.getTextField('Reference Name Expression').should('exist'); details.getTextField('Label Expression').type('Test Widget Reference'); details.getTextField('Reference Name Expression').type(`${reference}{enter}`); @@ -141,7 +141,7 @@ describe('Forms Widget-reference', () => { explorer.getTreeItemByLabel('standard').trigger('dragstart', { dataTransfer: dataTransferStandardExplorer }); form.getWidget('Test Widget Reference').trigger('drop', { dataTransfer: dataTransferStandardExplorer }); form.getWidgetElement('Test Widget Reference', 'reference-value-standard').should('exist'); - explorer.createObject('DataSource1', 'Data Flow'); + explorer.createObject('DataSource1', 'outgoingFlows-DataFlow'); form.getWidget('Test Widget Reference').click(); cy.getByTestId('option-standard').should('not.exist'); cy.getByTestId('option-unused').should('exist'); @@ -170,7 +170,10 @@ describe('Forms Widget-reference', () => { .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); cy.getByTestId('childCreationDescription').get('[data-value]').should('have.length', 1); - cy.getByTestId('childCreationDescription').get('[data-value="Power Output"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="powerOutputs-PowerOutput"]') + .should('exist') + .click(); cy.getByTestId('create-modal').findByTestId('create-object').click(); cy.getByTestId('reference-value-1000').should('exist'); explorer.getTreeItemByLabel('1000').should('exist'); @@ -202,7 +205,10 @@ describe('Forms Widget-reference', () => { .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); cy.getByTestId('childCreationDescription').get('[data-value]').should('have.length', 1); - cy.getByTestId('childCreationDescription').get('[data-value="Power Output"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="powerOutputs-PowerOutput"]') + .should('exist') + .click(); cy.getByTestId('create-modal').findByTestId('create-object').click(); cy.getByTestId('reference-value-1000').should('exist'); explorer.getTreeItemByLabel('1000').should('exist'); @@ -258,7 +264,7 @@ describe('Forms Widget-reference', () => { cy.getByTestId('childCreationDescription') .get('[data-value]') .should('have.length', 2) - .get('[data-value="Elements Data Flow"]') + .get('[data-value="elements-DataFlow"]') .should('exist') .click(); cy.getByTestId('create-modal').findByTestId('create-object').click(); @@ -297,21 +303,21 @@ describe('Forms Widget-reference', () => { const explorer = new Explorer(); const details = new Details(); const form = new Form(); - explorer.createObject(domainName, 'Entity'); + explorer.createObject(domainName, 'types-Entity'); details.getTextField('Name').should('have.value', 'NewEntity'); details.getTextField('Name').type('{selectall}SuperEntity1{enter}'); details.getCheckBox('Abstract').check(); - explorer.createObject(domainName, 'Entity'); + explorer.createObject(domainName, 'types-Entity'); details.getTextField('Name').should('have.value', 'NewEntity'); details.getTextField('Name').type('{selectall}MonoValuedContainment{enter}'); - explorer.createObject('MonoValuedContainment', 'Attribute'); + explorer.createObject('MonoValuedContainment', 'attributes-Attribute'); details.getTextField('Name').should('have.value', 'newString'); details.getTextField('Name').type('{selectall}Name{enter}'); - explorer.createObject('SuperEntity1', 'Relation'); + explorer.createObject('SuperEntity1', 'relations-Relation'); details.getCheckBox('Containment').check(); details.getCheckBox('Many').uncheck(); details.openReferenceWidgetOptions('Target Type'); @@ -329,7 +335,7 @@ describe('Forms Widget-reference', () => { instanceProjectId = res.projectId; }); - explorer.createObject('Root', 'Entity1s Entity1'); + explorer.createObject('Root', 'entity1s-Entity1'); explorer.select('Entity1'); details.getTextField('Name').type('{selectall}Entity1{enter}'); @@ -348,7 +354,7 @@ describe('Forms Widget-reference', () => { cy.getByTestId('childCreationDescription').click(); cy.getByTestId('childCreationDescription').get('[data-value]').should('have.length', 1); cy.getByTestId('childCreationDescription') - .get('[data-value="Relation Mono Valued Containment"]') + .get('[data-value="relation-MonoValuedContainment"]') .should('exist') .click(); cy.getByTestId('create-modal').findByTestId('create-object').click(); @@ -371,7 +377,7 @@ describe('Forms Widget-reference', () => { cy.getByTestId('childCreationDescription').click(); cy.getByTestId('childCreationDescription').get('[data-value]').should('have.length', 1); cy.getByTestId('childCreationDescription') - .get('[data-value="Relation Mono Valued Containment"]') + .get('[data-value="relation-MonoValuedContainment"]') .should('exist') .click(); cy.getByTestId('create-modal').findByTestId('create-object').click(); @@ -384,28 +390,28 @@ describe('Forms Widget-reference', () => { const form = new Form(); explorer.expand(domainName); - explorer.createObject('Entity1', 'Relation'); + explorer.createObject('Entity1', 'relations-Relation'); details.getCheckBox('Containment').check(); details.openReferenceWidgetOptions('Target Type'); details.selectReferenceWidgetOption('Entity2'); - explorer.createObject('Entity2', 'Relation'); + explorer.createObject('Entity2', 'relations-Relation'); details.getCheckBox('Containment').check(); details.openReferenceWidgetOptions('Target Type'); details.selectReferenceWidgetOption('Entity1'); explorer.expand('ViewNewModel'); - explorer.createObject('View', 'Form Description'); + explorer.createObject('View', 'descriptions-FormDescription'); explorer.select('New Form Description'); details.getTextField('Domain Type').type(`${domainName}::Entity1`); details.getTextField('Name').type(`{selectall}WidgetRefRepresentation{enter}`); details.getTextField('Title Expression').type(`{selectall}WidgetRefRepresentation{enter}`); explorer.expand('WidgetRefRepresentation'); explorer.expand('PageDescription'); - explorer.createObject('GroupDescription', 'Widgets Reference Widget Description'); + explorer.createObject('Group Description', 'children-ReferenceWidgetDescription'); details.getTextField('Reference Name Expression').should('exist'); details.getTextField('Label Expression').type('Test Widget Reference linkedTo'); details.getTextField('Reference Name Expression').type(`linkedTo{enter}`); - explorer.createObject('GroupDescription', 'Widgets Reference Widget Description'); + explorer.createObject('Group Description', 'children-ReferenceWidgetDescription'); details.getTextField('Reference Name Expression').should('exist'); details.getTextField('Label Expression').type('Test Widget Reference relation'); details.getTextField('Reference Name Expression').type(`relation{enter}`); @@ -414,10 +420,10 @@ describe('Forms Widget-reference', () => { instanceProjectId = res.projectId; }); - explorer.createObject('Root', 'Entity2s Entity2'); + explorer.createObject('Root', 'entity2s-Entity2'); explorer.select('Entity2'); details.getTextField('Name').type('{selectall}Entity2{enter}'); - explorer.createObject('Entity2', 'Relation Entity1'); + explorer.createObject('Entity2', 'relation-Entity1'); explorer.createRepresentation('Entity1', 'WidgetRefRepresentation', 'WidgetRefRepresentation'); form.getWidget('Test Widget Reference linkedTo').click(); diff --git a/integration-tests/cypress/e2e/project/studio/color-palette.cy.js b/integration-tests/cypress/e2e/project/studio/color-palette.cy.js index e044e58149..23a44959e1 100644 --- a/integration-tests/cypress/e2e/project/studio/color-palette.cy.js +++ b/integration-tests/cypress/e2e/project/studio/color-palette.cy.js @@ -34,7 +34,7 @@ describe('/projects/:projectId/edit - Color Palette', () => { cy.getByTestId('ColorPalette-more').click(); cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); - cy.getByTestId('childCreationDescription').click().get('[data-value="Fixed Color"]').should('exist').click(); + cy.getByTestId('childCreationDescription').click().get('[data-value="colors-FixedColor"]').should('exist').click(); cy.getByTestId('create-object').click(); cy.getByTestId('FixedColor').should('exist').click(); cy.getByTestId('Name').type('color_test{enter}'); @@ -48,14 +48,14 @@ describe('/projects/:projectId/edit - Color Palette', () => { cy.getByTestId('View-more').click(); cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); - cy.getByTestId('childCreationDescription').click().get('[data-value="Color Palette"]').should('exist').click(); + cy.getByTestId('childCreationDescription').click().get('[data-value="colorPalettes-ColorPalette"]').should('exist').click(); cy.getByTestId('create-object').click(); cy.getByTestId('New Color Palette').should('exist').click(); cy.getByTestId('Name').clear().type('OtherColorPalette{enter}'); cy.getByTestId('OtherColorPalette-more').click(); cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1); - cy.getByTestId('childCreationDescription').click().get('[data-value="Fixed Color"]').should('exist'); + cy.getByTestId('childCreationDescription').click().get('[data-value="colors-FixedColor"]').should('exist'); }); it('can select color from color palette in node style properties', () => { diff --git a/integration-tests/cypress/e2e/project/studio/studio.cy.ts b/integration-tests/cypress/e2e/project/studio/studio.cy.ts index 3c97e47441..3bcec87eb1 100644 --- a/integration-tests/cypress/e2e/project/studio/studio.cy.ts +++ b/integration-tests/cypress/e2e/project/studio/studio.cy.ts @@ -77,15 +77,15 @@ describe('/projects/:projectId/edit - Studio', () => { cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').find('input').invoke('val').should('not.be.empty'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Diagram Tool Section"]').should('exist').click(); + cy.get('[data-value="toolSections-DiagramToolSection"]').should('exist').click(); cy.getByTestId('create-object').click(); cy.getByTestId('Tool Section').should('exist'); cy.getByTestId('Tool Section-more').click(); cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').find('input').invoke('val').should('not.be.empty'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Node Tool"]').should('exist'); - cy.get('[data-value="Edge Tool"]').should('not.exist'); + cy.get('[data-value="nodeTools-NodeTool"]').should('exist'); + cy.get('[data-value="edgeTools-EdgeTool"]').should('not.exist'); }); it('Check the NodePalette toolSection creation', () => { @@ -97,16 +97,16 @@ describe('/projects/:projectId/edit - Studio', () => { cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').find('input').invoke('val').should('not.be.empty'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Node Tool Section"]').should('exist').click(); + cy.get('[data-value="toolSections-NodeToolSection"]').should('exist').click(); cy.getByTestId('create-object').click(); cy.getByTestId('Tool Section').should('exist'); cy.getByTestId('Tool Section-more').click(); cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').find('input').invoke('val').should('not.be.empty'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Node Tool"]').should('exist'); - cy.get('[data-value="Edge Tool"]').should('exist'); - cy.get('[data-value="Source Edge End Reconnection Tool"]').should('not.exist'); + cy.get('[data-value="nodeTools-NodeTool"]').should('exist'); + cy.get('[data-value="edgeTools-EdgeTool"]').should('exist'); + cy.get('[data-value="edgeReconnectionTools-SourceEdgeEndReconnectionTool"]').should('not.exist'); }); it('Check the EdgePalette toolSection creation', () => { @@ -118,17 +118,17 @@ describe('/projects/:projectId/edit - Studio', () => { cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').find('input').invoke('val').should('not.be.empty'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Edge Tool Section"]').should('exist').click(); + cy.get('[data-value="toolSections-EdgeToolSection"]').should('exist').click(); cy.getByTestId('create-object').click(); cy.getByTestId('Tool Section').should('exist'); cy.getByTestId('Tool Section-more').click(); cy.getByTestId('new-object').click(); cy.getByTestId('childCreationDescription').find('input').invoke('val').should('not.be.empty'); cy.getByTestId('childCreationDescription').click(); - cy.get('[data-value="Node Tool"]').should('exist'); - cy.get('[data-value="Edge Tool"]').should('not.exist'); - cy.get('[data-value="Source Edge End Reconnection Tool"]').should('not.exist'); - cy.get('[data-value="Target Edge End Reconnection Tool"]').should('not.exist'); + cy.get('[data-value="nodeTools-NodeTool"]').should('exist'); + cy.get('[data-value="edgeTools-EdgeTool"]').should('not.exist'); + cy.get('[data-value="edgeReconnectionTools-SourceEdgeEndReconnectionTool"]').should('not.exist'); + cy.get('[data-value="edgeReconnectionTools-TargetEdgeEndReconnectionTool"]').should('not.exist'); }); it.skip('Check the precondition on tools', () => { @@ -142,7 +142,7 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Node Tool"]').should('exist').click(); + cy.getByTestId('childCreationDescription').get('[data-value="nodeTools-NodeTool"]').should('exist').click(); cy.getByTestId('create-object').click(); cy.getByTestId('Precondition Expression').should('exist'); cy.getByTestId('Precondition Expression').type('aql:self.eAllContents()->size()>0'); @@ -209,7 +209,7 @@ describe('/projects/:projectId/edit - Studio', () => { details.getReferenceWidgetSelectedValue('Background', 'white').should('exist'); details.getReferenceWidgetSelectedValue('Border Color', 'black').should('exist'); explorer.delete('RectangularNodeStyleDescription'); - explorer.createObject('Node', 'Style Icon-Label'); + explorer.createObject('Node', 'style-IconLabelNodeStyleDescription'); details.getReferenceWidgetSelectedValue('Background', 'white').should('exist'); details.getReferenceWidgetSelectedValue('Border Color', 'black').should('exist'); }); @@ -225,7 +225,10 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Node Description"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="nodeDescriptions-NodeDescription"]') + .should('exist') + .click(); cy.getByTestId('create-object').click(); cy.getByTestId('Node-toggle').click(); cy.getByTestId('Node-more').click(); @@ -235,7 +238,10 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Sub-node"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="childrenDescriptions-NodeDescription"]') + .should('exist') + .click(); cy.getByTestId('create-object').click(); cy.getByTestId('Sub-node-toggle').click(); cy.getByTestId('RectangularNodeStyleDescription').eq(1).click(); @@ -254,7 +260,10 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Node Description"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="nodeDescriptions-NodeDescription"]') + .should('exist') + .click(); cy.getByTestId('create-object').click(); cy.getByTestId('Node-toggle').click(); cy.getByTestId('Node-more').click(); @@ -264,7 +273,10 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Border node"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="borderNodesDescriptions-NodeDescription"]') + .should('exist') + .click(); cy.getByTestId('create-object').click(); cy.getByTestId('Border node-toggle').click(); cy.getByTestId('RectangularNodeStyleDescription').eq(1).click(); @@ -286,7 +298,10 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Style Rectangular"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="style-RectangularNodeStyleDescription"]') + .should('exist') + .click(); cy.getByTestId('create-object').click(); cy.getByTestId('RectangularNodeStyleDescription').click(); cy.getByTestId('Background').findByTestId('reference-value-white').should('exist'); @@ -304,7 +319,10 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Edge Description"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="edgeDescriptions-EdgeDescription"]') + .should('exist') + .click(); cy.getByTestId('create-object').click(); cy.getByTestId('Edge').dblclick(); cy.getByTestId('EdgeStyle').click(); @@ -321,7 +339,10 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Form Description"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="descriptions-FormDescription"]') + .should('exist') + .click(); cy.getByTestId('create-object').click(); cy.getByTestId('New Form Description').dblclick(); cy.getByTestId('PageDescription').dblclick(); @@ -334,7 +355,7 @@ describe('/projects/:projectId/edit - Studio', () => { .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); cy.getByTestId('childCreationDescription') - .get('[data-value="Widgets Textfield Description"]') + .get('[data-value="children-TextfieldDescription"]') .should('exist') .click(); cy.getByTestId('create-object').click(); @@ -346,7 +367,7 @@ describe('/projects/:projectId/edit - Studio', () => { .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); cy.getByTestId('childCreationDescription') - .get('[data-value="Style Textfield Description Style"]') + .get('[data-value="style-TextfieldDescriptionStyle"]') .should('exist') .click(); cy.getByTestId('create-object').click(); @@ -370,7 +391,10 @@ describe('/projects/:projectId/edit - Studio', () => { .invoke('text') .should('have.length.gt', 1); cy.getByTestId('childCreationDescription').click(); - cy.getByTestId('childCreationDescription').get('[data-value="Node Description"]').should('exist').click(); + cy.getByTestId('childCreationDescription') + .get('[data-value="nodeDescriptions-NodeDescription"]') + .should('exist') + .click(); cy.getByTestId('create-object').click(); cy.getByTestId('Node').click(); cy.getByTestId('Default Width Expression').should('exist'); diff --git a/integration-tests/cypress/workbench/Deck.ts b/integration-tests/cypress/workbench/Deck.ts index 6e21193893..52d5714646 100644 --- a/integration-tests/cypress/workbench/Deck.ts +++ b/integration-tests/cypress/workbench/Deck.ts @@ -140,7 +140,9 @@ export class Deck { { condition, backgroundColor, color, italic, bold, underline, strikeThrough, fontSize }: ElementStyleProps ) { const details = new Details(); - const objectName = `${condition ? 'Conditional Style' : 'Style'} Description`; + const objectName = condition + ? 'conditionalStyles-ConditionalDeckElementDescriptionStyle' + : 'style-DeckElementDescriptionStyle'; cy.createChildObject(elementName, objectName); details.openReferenceWidgetOptions('Background Color'); details.selectReferenceWidgetOption(backgroundColor); @@ -162,7 +164,7 @@ export class Deck { public createDeckRepresentationtyle(elementName: string, backgroundColor: string, condition?: string) { const details = new Details(); - const objectName = `${condition ? 'Conditional Style' : 'Style'} Description`; + const objectName = condition ? 'conditionalStyles-ConditionalDeckDescriptionStyle' : 'style-DeckDescriptionStyle'; cy.createChildObject(elementName, objectName); details.openReferenceWidgetOptions('Background Color'); details.selectReferenceWidgetOption(backgroundColor); diff --git a/packages/emf/backend/sirius-components-emf/src/main/java/org/eclipse/sirius/components/emf/services/DefaultEditService.java b/packages/emf/backend/sirius-components-emf/src/main/java/org/eclipse/sirius/components/emf/services/DefaultEditService.java index 618253f112..2d752373e0 100644 --- a/packages/emf/backend/sirius-components-emf/src/main/java/org/eclipse/sirius/components/emf/services/DefaultEditService.java +++ b/packages/emf/backend/sirius-components-emf/src/main/java/org/eclipse/sirius/components/emf/services/DefaultEditService.java @@ -146,9 +146,10 @@ public List getChildCreationDescriptions(IEditingConte if (adapter instanceof IEditingDomainItemProvider editingDomainItemProvider) { if (editingDomainItemProvider instanceof Helper helper) { for (CommandParameter commandParameter : commandParameters) { - String text = helper.getCreateChildText(eObject, commandParameter.getFeature(), commandParameter.getValue(), null); + String id = this.getChildCreationDescriptionId(commandParameter); + String label = helper.getCreateChildText(eObject, commandParameter.getFeature(), commandParameter.getValue(), null); List iconURL = this.objectService.getImagePath(commandParameter.getValue()); - ChildCreationDescription childCreationDescription = new ChildCreationDescription(text, text, iconURL); + ChildCreationDescription childCreationDescription = new ChildCreationDescription(id, label, iconURL); childCreationDescriptions.add(childCreationDescription); } } @@ -176,27 +177,23 @@ public Optional createChild(IEditingContext editingContext, Object objec Collection newChildDescriptors = editingDomain.getNewChildDescriptors(eObject, null); - List commandParameters = newChildDescriptors.stream() + return newChildDescriptors.stream() .filter(CommandParameter.class::isInstance) .map(CommandParameter.class::cast) - .toList(); - - Adapter adapter = editingDomain.getAdapterFactory().adapt(eObject, IEditingDomainItemProvider.class); - if (adapter instanceof IEditingDomainItemProvider editingDomainItemProvider) { - if (editingDomainItemProvider instanceof Helper helper) { - for (CommandParameter commandParameter : commandParameters) { - String text = helper.getCreateChildText(eObject, commandParameter.getFeature(), commandParameter.getValue(), null); - - if (childCreationDescriptionId.equals(text)) { - return this.createObject(editingDomain, eObject, commandParameter); - } - } - } - } + .filter(commandParameter -> childCreationDescriptionId.equals(this.getChildCreationDescriptionId(commandParameter))) + .findFirst() + .flatMap(commandParameter -> this.createObject(editingDomain, eObject, commandParameter)); } return Optional.empty(); } + private String getChildCreationDescriptionId(CommandParameter commandParameter) { + if (commandParameter.getFeature() instanceof EReference eReference && commandParameter.getValue() instanceof EObject eObject) { + return eReference.getName() + "-" + eObject.eClass().getName(); + } + return commandParameter.toString(); + } + private Optional createObject(AdapterFactoryEditingDomain editingDomain, EObject eObject, CommandParameter commandParameter) { Optional objectOptional = Optional.empty(); diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/objects/ObjectCreationControllerIntegrationTests.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/objects/ObjectCreationControllerIntegrationTests.java index c036ce6f7e..4da4ea6a47 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/objects/ObjectCreationControllerIntegrationTests.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/objects/ObjectCreationControllerIntegrationTests.java @@ -137,7 +137,7 @@ public void givenAnObjectWhenChildObjectCreationDescriptionsAreRequestedThenVali List creationDescriptionIds = JsonPath.read(result, "$.data.viewer.editingContext.childCreationDescriptions[*].id"); assertThat(creationDescriptionIds) .isNotEmpty() - .contains("Humans Human"); + .contains("humans-Human"); List> creationDescriptionIconURLs = JsonPath.read(result, "$.data.viewer.editingContext.childCreationDescriptions[*].iconURL"); assertThat(creationDescriptionIconURLs).hasSize(1); @@ -184,7 +184,7 @@ public void givenObjectWhenChildObjectIsCreatedThenItIsCreatedProperly() { UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_PROJECT.toString(), StudioIdentifiers.DOMAIN_OBJECT.toString(), - "Entity" + "types-Entity" ); var result = this.createChildMutationRunner.run(input);