Skip to content

Commit

Permalink
Fixing constraint reference problem
Browse files Browse the repository at this point in the history
When there are reference with constraint there are using every time the reference one not that one that are defined inside the Model.
  • Loading branch information
michelu89 committed May 17, 2024
1 parent 5d4e11e commit 809faec
Show file tree
Hide file tree
Showing 327 changed files with 1,405 additions and 1,094 deletions.
2 changes: 1 addition & 1 deletion core/apps/ame-e2e/src/fixtures/valid-documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
~ SPDX-License-Identifier: MPL-2.0
-->

<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>Test Documentation</title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Test drag and drop ext characteristic', () => {
},
{
fixture: `/external-reference/different-namespace/without-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand All @@ -61,7 +61,7 @@ describe('Test drag and drop ext characteristic', () => {
expect(rdf).to.contain(':property1 a samm:Property');
expect(rdf).to.contain('samm:characteristic ext-different:ExternalCharacteristic');
expect(rdf).not.contain(':ExternalCharacteristic a samm:Characteristic');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Test drag and drop ext constraint', () => {
},
{
fixture: `/external-reference/different-namespace/without-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('Test drag and drop ext constraint', () => {
expect(rdf).to.contain(':Characteristic1 a samm:Characteristic');
expect(rdf).to.contain('samm-c:constraint ext-different:ExternalConstraint');
expect(rdf).not.contain(':ExternalConstraint a samm:Constraint');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Test drag and drop', () => {
},
{
fixture: `/external-reference/different-namespace/without-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand All @@ -64,7 +64,7 @@ describe('Test drag and drop', () => {
expect(rdf).to.contain('samm:dataType ext-different:ExternalEntity');

expect(rdf).not.contain(':ExternalEntity a samm:Entity');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Test drag and drop ext properties', () => {
},
{
fixture: `/external-reference/different-namespace/with-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('Test drag and drop ext properties', () => {
expect(rdf).not.contain('samm:characteristic samm-c:Boolean');
expect(rdf).not.contain(':ChildrenCharacteristic2 a samm:Characteristic');
expect(rdf).not.contain(':ChildrenEntity2 a samm:Entity');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Test drag and drop ext properties', () => {
},
{
fixture: `/external-reference/different-namespace/without-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand All @@ -63,7 +63,7 @@ describe('Test drag and drop ext properties', () => {
expect(rdf).to.contain(':Characteristic1 a samm:Characteristic');

expect(rdf).not.contain(':externalProperty a samm:Property');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ describe('Test drag and drop', () => {

.then(() => cy.clickConnectShapes('AspectDefault', 'operation1'))
.then(() =>
cyHelp.hasAddInputAndOutputShapeOverlay('operation1').then(hasInputAndOutputOverlay => expect(hasInputAndOutputOverlay).equal(true))
cyHelp
.hasAddInputAndOutputShapeOverlay('operation1')
.then(hasInputAndOutputOverlay => expect(hasInputAndOutputOverlay).equal(true)),
)

.then(() => cy.clickConnectShapes('property2', 'Trait1'))
Expand Down Expand Up @@ -77,7 +79,7 @@ describe('Test drag and drop', () => {
expect(aspect.properties[1].property.characteristic.name).to.equals('Trait1');
expect(aspect.properties[1].property.characteristic.baseCharacteristic.name).to.equals('Characteristic1');
expect(aspect.properties[1].property.characteristic.baseCharacteristic.dataType.name).to.equals('Entity1');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Test drag and drop ext characteristic', () => {
},
{
fixture: `/external-reference/same-namespace/without-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand All @@ -62,7 +62,7 @@ describe('Test drag and drop ext characteristic', () => {
expect(rdf).to.contain(':property1 a samm:Property');
expect(rdf).to.contain('samm:characteristic :ExternalCharacteristic');
expect(rdf).not.contain(':ExternalCharacteristic a samm:Characteristic');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Test drag and drop ext constraint', () => {
},
{
fixture: `/external-reference/same-namespace/without-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('Test drag and drop ext constraint', () => {
expect(rdf).to.contain(':Characteristic1 a samm:Characteristic');
expect(rdf).to.contain('samm-c:constraint :ExternalConstraint');
expect(rdf).not.contain(':ExternalConstraint a samm:Constraint');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Test drag and drop', () => {
},
{
fixture: `/external-reference/same-namespace/without-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand All @@ -62,7 +62,7 @@ describe('Test drag and drop', () => {
expect(rdf).to.contain('samm:dataType :ExternalEntity');

expect(rdf).not.contain(':ExternalEntity a samm:Entity');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Test drag and drop ext properties', () => {
},
{
fixture: `/external-reference/same-namespace/with-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('Test drag and drop ext properties', () => {
expect(rdf).not.contain('samm:characteristic samm-c:Boolean');
expect(rdf).not.contain(':ChildrenCharacteristic2 a samm:Characteristic');
expect(rdf).not.contain(':ChildrenEntity2 a samm:Entity');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Test drag and drop ext properties', () => {
},
{
fixture: `/external-reference/same-namespace/without-childrens/${fileName}`,
}
},
);

cy.visitDefault().then(() =>
Expand All @@ -60,7 +60,7 @@ describe('Test drag and drop ext properties', () => {
expect(rdf).to.contain('samm:characteristic :Characteristic1');
expect(rdf).to.contain(':Characteristic1 a samm:Characteristic');
expect(rdf).not.contain(':externalProperty a samm:Property');
})
}),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ describe('Test create recursive element', () => {
expect(rdf).to.contain(':newProperty3 a samm:Property;\n' + ' samm:characteristic :NewCharacteristic.');
cy.getAspect().then(aspect => {
expect(aspect.properties[0].property.characteristic.dataType.properties[0].property.characteristic.name).to.equal(
'NewCharacteristic'
'NewCharacteristic',
);
expect(aspect.properties[0].property.characteristic.dataType.properties[1].property.characteristic.name).to.equal(
'NewCharacteristic'
'NewCharacteristic',
);
});
cyHelp.hasAddShapeOverlay('newProperty2').then(addShapeIcon => expect(addShapeIcon).to.be.false);
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('Test create recursive element', () => {
expect(rdf).to.contain(':newProperty2 a samm:Property;\n' + ' samm:characteristic :Property1Trait.');
expect(rdf).to.contain(':newProperty3 a samm:Property;\n' + ' samm:characteristic :Property1Trait.');
expect(rdf).to.contain(
':Property1Trait a samm-c:Trait;\n' + ' samm-c:baseCharacteristic :Characteristic1;\n' + ' samm-c:constraint :Constraint1.'
':Property1Trait a samm-c:Trait;\n' + ' samm-c:baseCharacteristic :Characteristic1;\n' + ' samm-c:constraint :Constraint1.',
);
expect(rdf).to.contain(':Constraint1 a samm:Constraint.\n');
expect(rdf).to.contain(':Characteristic1 a samm:Characteristic;\n' + ' samm:dataType :NewEntity.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('Create and Edit Abstract Entity', () => {
.then(() => cy.get(FIELD_preferredNameen).focus().clear().type('New preferred Name'))
.then(() => cyHelp.clickSaveButton())
.then(() =>
cy.getCellLabel('AbstractEntity1', META_MODEL_preferredName).should('eq', `${META_MODEL_preferredName} = New preferred Name @en`)
cy.getCellLabel('AbstractEntity1', META_MODEL_preferredName).should('eq', `${META_MODEL_preferredName} = New preferred Name @en`),
)
.then(() => cy.getUpdatedRDF())
.then(rdf => expect(rdf).to.contain('samm:preferredName "New preferred Name"@en'));
Expand All @@ -86,7 +86,7 @@ describe('Create and Edit Abstract Entity', () => {
.then(() => cy.get(FIELD_descriptionen).focus().clear().type('New description'))
.then(() => cyHelp.clickSaveButton())
.then(() =>
cy.getCellLabel('AbstractEntity1', META_MODEL_description).should('eq', `${META_MODEL_description} = New description @en`)
cy.getCellLabel('AbstractEntity1', META_MODEL_description).should('eq', `${META_MODEL_description} = New description @en`),
)
.then(() => cy.getUpdatedRDF().then(rdf => expect(rdf).to.contain('samm:description "New description"@en')));
});
Expand All @@ -99,7 +99,7 @@ describe('Create and Edit Abstract Entity', () => {
.then(() =>
cy
.getCellLabel('AbstractEntity1', META_MODEL_see)
.should('eq', `${META_MODEL_see} = urn:irdi:eclass:0173-1#02-AAO677,urn:irdi:iec:0112/2///62683#ACC011#001`)
.should('eq', `${META_MODEL_see} = urn:irdi:eclass:0173-1#02-AAO677,urn:irdi:iec:0112/2///62683#ACC011#001`),
)
.then(() => cy.getUpdatedRDF())
.then(rdf => expect(rdf).to.contain('samm:see <urn:irdi:eclass:0173-1#02-AAO677>, <urn:irdi:iec:0112/2///62683#ACC011#001>'));
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('Create and Edit Abstract Entity', () => {

it('should reconnect to AbstractEntity1', () => {
cy.then(() => cy.clickConnectShapes('Entity1', 'AbstractEntity1')).then(() =>
cy.getCellLabel('Entity1', 'extends').should('eq', 'extends = AbstractEntity1')
cy.getCellLabel('Entity1', 'extends').should('eq', 'extends = AbstractEntity1'),
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Create and Edit Abstract Property', () => {
.then(() =>
cy
.getCellLabel('abstractProperty1', META_MODEL_preferredName)
.should('eq', `${META_MODEL_preferredName} = New preferred Name @en`)
.should('eq', `${META_MODEL_preferredName} = New preferred Name @en`),
)
.then(() => cy.getUpdatedRDF())
.then(rdf => expect(rdf).to.contain('samm:preferredName "New preferred Name"@en'));
Expand All @@ -85,7 +85,7 @@ describe('Create and Edit Abstract Property', () => {
.then(() => cy.get(FIELD_descriptionen).focus().clear().type('New description'))
.then(() => cyHelp.clickSaveButton())
.then(() =>
cy.getCellLabel('abstractProperty1', META_MODEL_description).should('eq', `${META_MODEL_description} = New description @en`)
cy.getCellLabel('abstractProperty1', META_MODEL_description).should('eq', `${META_MODEL_description} = New description @en`),
)
.then(() => cy.getUpdatedRDF().then(rdf => expect(rdf).to.contain('samm:description "New description"@en')));
});
Expand All @@ -98,7 +98,7 @@ describe('Create and Edit Abstract Property', () => {
.then(() =>
cy
.getCellLabel('abstractProperty1', META_MODEL_see)
.should('eq', `${META_MODEL_see} = urn:irdi:eclass:0173-1#02-AAO677,urn:irdi:iec:0112/2///62683#ACC011#001`)
.should('eq', `${META_MODEL_see} = urn:irdi:eclass:0173-1#02-AAO677,urn:irdi:iec:0112/2///62683#ACC011#001`),
)
.then(() => cy.getUpdatedRDF())
.then(rdf => expect(rdf).to.contain('samm:see <urn:irdi:eclass:0173-1#02-AAO677>, <urn:irdi:iec:0112/2///62683#ACC011#001>'));
Expand All @@ -107,7 +107,7 @@ describe('Create and Edit Abstract Property', () => {
.then(() => cy.removeSeeElements().addSeeElements('urn:irdi:eclass:0173-1#02-AAO677'))
.then(() => cyHelp.clickSaveButton())
.then(() =>
cy.getCellLabel('abstractProperty1', META_MODEL_see).should('eq', `${META_MODEL_see} = urn:irdi:eclass:0173-1#02-AAO677`)
cy.getCellLabel('abstractProperty1', META_MODEL_see).should('eq', `${META_MODEL_see} = urn:irdi:eclass:0173-1#02-AAO677`),
)
.then(() => cy.getUpdatedRDF())
.then(rdf => expect(rdf).to.contain('samm:see <urn:irdi:eclass:0173-1#02-AAO677>'));
Expand Down
14 changes: 7 additions & 7 deletions core/apps/ame-e2e/src/integration/editor/edit-aspect.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('Test editing Aspect', () => {
.then(() =>
cy
.getCellLabel('NewAspect', META_MODEL_preferredName)
.should('eq', `${META_MODEL_preferredName} = New Preffered Name for Aspect @en`)
.should('eq', `${META_MODEL_preferredName} = New Preffered Name for Aspect @en`),
)
.then(() => cy.getUpdatedRDF())
.then(rdf => expect(rdf).to.contain('samm:preferredName "New Preffered Name for Aspect"@en'))
Expand All @@ -113,7 +113,7 @@ describe('Test editing Aspect', () => {
.then(() =>
cy
.getCellLabel('NewAspect', META_MODEL_description)
.should('eq', `${META_MODEL_description} = New description for the aspect model @en`)
.should('eq', `${META_MODEL_description} = New description for the aspect model @en`),
)
.then(() => cy.getUpdatedRDF().then(rdf => expect(rdf).to.contain('samm:description "New description for the aspect model"@en')))
.then(() => cy.getAspect().then(aspect => expect(aspect.getDescription('en')).to.equal('New description for the aspect model')));
Expand All @@ -127,16 +127,16 @@ describe('Test editing Aspect', () => {
.then(() =>
cy
.getCellLabel('NewAspect', META_MODEL_see)
.should('eq', `${META_MODEL_see} = http://www.seeA.de,http://www.seeB.de,http://www.seeC.de`)
.should('eq', `${META_MODEL_see} = http://www.seeA.de,http://www.seeB.de,http://www.seeC.de`),
)
.then(() =>
cy.getUpdatedRDF().then(rdf => expect(rdf).to.contain('samm:see <http://www.seeA.de>, <http://www.seeB.de>, <http://www.seeC.de>'))
cy.getUpdatedRDF().then(rdf => expect(rdf).to.contain('samm:see <http://www.seeA.de>, <http://www.seeB.de>, <http://www.seeC.de>')),
)
.then(() =>
cy.getAspect().then(aspect => {
expect(aspect.getSeeReferences()).to.have.length(3);
expect(aspect.getSeeReferences()[2]).to.equal('http://www.seeC.de');
})
}),
);
cy.dbClickShape('NewAspect')
.then(() => cy.removeSeeElements('http://www.seeB.de'))
Expand All @@ -148,7 +148,7 @@ describe('Test editing Aspect', () => {
cy.getAspect().then(aspect => {
expect(aspect.getSeeReferences()).to.have.length(2);
expect(aspect.getSeeReferences()[1]).to.equal('http://www.seeC.de');
})
}),
);
});

Expand All @@ -161,7 +161,7 @@ describe('Test editing Aspect', () => {
.then(() =>
cy
.getCellLabel('NewAspect', META_MODEL_see)
.should('eq', `${META_MODEL_see} = urn:irdi:eclass:0173-1#02-AAO677,urn:irdi:iec:0112/2///62683#ACC011#001`)
.should('eq', `${META_MODEL_see} = urn:irdi:eclass:0173-1#02-AAO677,urn:irdi:iec:0112/2///62683#ACC011#001`),
)
.then(() => cy.getUpdatedRDF())
.then(rdf => expect(rdf).to.contain('samm:see <urn:irdi:eclass:0173-1#02-AAO677>, <urn:irdi:iec:0112/2///62683#ACC011#001>'))
Expand Down
Loading

0 comments on commit 809faec

Please sign in to comment.