Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Commit 367e48f

Browse files
committed
Update Tests to newer GLSP version
1 parent 981f9b1 commit 367e48f

3 files changed

Lines changed: 2182 additions & 299 deletions

File tree

client/tests/test.ts

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,16 @@ const writeQuickAccessBar = async (t, text) => {
121121

122122
await t
123123
.typeText(quickAccess, text)
124+
.pressKey('Down')
124125
.pressKey('Enter');
125126
};
126127

127-
const createNode = async (t, name) => {
128+
const createNode = async (t, name, x, y) => {
128129
const selector = Selector('div.tool-group > div.tool-button').withText(name);
129130
const svgCanvas = Selector('svg.sprotty-graph');
130131
await t
131132
.click(selector)
132-
.click(svgCanvas);
133+
.click(svgCanvas, {offsetX : x, offsetY : y});
133134
};
134135

135136
const deleteNode = async (t, selector) => {
@@ -180,15 +181,15 @@ test('Open Workbench', async t => {
180181
test('Switch Theme', async t => {
181182

182183
openQuickAccessBar(t);
183-
writeQuickAccessBar(t, "Change Color Theme");
184-
writeQuickAccessBar(t, "Dark");
184+
writeQuickAccessBar(t, "Color Theme");
185+
writeQuickAccessBar(t, "Dark (Theia)");
185186

186187
await t
187-
.expect(Selector('div.p-Widget.p-DockPanel.p-SplitPanel-child').getStyleProperty('color')).eql('rgb(224, 224, 224)');
188+
.expect(Selector('div.p-Widget.p-DockPanel.p-SplitPanel-child').getStyleProperty('color')).eql('rgb(204, 204, 204)');
188189

189190
openQuickAccessBar(t);
190-
writeQuickAccessBar(t, "Change Color Theme");
191-
writeQuickAccessBar(t, "Light");
191+
writeQuickAccessBar(t, "Color Theme");
192+
writeQuickAccessBar(t, "Light (Theia)");
192193

193194
await t
194195
.expect(Selector('div.p-Widget.p-DockPanel.p-SplitPanel-child').getStyleProperty('color')).eql('rgb(97, 97, 97)');
@@ -217,7 +218,7 @@ test('Deletion/Renaming of enotation', async t => {
217218
.rightClick(await fileSelect('test_copy.enotation'))
218219
.click(selectors.renameFile)
219220
.pressKey('ctrl+a')
220-
.typeText(selectors.renameInput, "test.enotation")
221+
.typeText(selectors.renameInput, "test.enotation", { replace: true })
221222
.pressKey('Enter');
222223

223224
}).after(checkDefaultWorkbench);
@@ -248,13 +249,11 @@ test('Create and Delete ecore file', async t => {
248249
test('Create Nodes', async t => {
249250
openFile(t, selectors.emptyEcore);
250251

251-
createNode(t, "Class");
252-
createNode(t, "Abstract");
253-
createNode(t, "Interface");
254-
createNode(t, "Enum");
255-
createNode(t, "DataType");
256-
257-
layout(t);
252+
createNode(t, "Class", 12, 12);
253+
createNode(t, "Abstract", 12, 62);
254+
createNode(t, "Interface", 12, 112);
255+
createNode(t, "Enum", 12, 162);
256+
createNode(t, "DataType", 12, 212);
258257

259258
await t
260259
.expect(defaultNodesSelector.classNode.exists).ok("Class has been created")
@@ -342,10 +341,10 @@ test('Add Attributes/Literals', async t => {
342341

343342
test('Layout new Diagram', async t => {
344343
openFile(t, selectors.emptyEcore);
345-
createNode(t, "Class");
346-
createNode(t, "Abstract");
347-
createNode(t, "Interface");
348-
createNode(t, "Enum");
344+
createNode(t, "Class", 100, 100);
345+
createNode(t, "Abstract", 100, 100);
346+
createNode(t, "Interface", 100, 100);
347+
createNode(t, "Enum", 100, 100);
349348

350349
layout(t);
351350

@@ -416,29 +415,22 @@ test('Renaming Classes/Attributes', async t => {
416415

417416
await t
418417
.doubleClick(nodesSelector.classNode)
419-
.typeText(selectors.input, "TestClass")
420-
.click(nodesSelector.abstractNode)
418+
.typeText(selectors.input, "TestClass", { replace: true })
421419
.doubleClick(nodesSelector.abstractNode)
422-
.typeText(selectors.input, "TestAbstract")
423-
.click(nodesSelector.interfaceNode)
420+
.typeText(selectors.input, "TestAbstract", { replace: true })
424421
.doubleClick(nodesSelector.interfaceNode)
425-
.typeText(selectors.input, "TestInterface")
426-
.click(nodesSelector.enumNode)
422+
.typeText(selectors.input, "TestInterface", { replace: true })
427423
.doubleClick(nodesSelector.enumNode)
428-
.typeText(selectors.input, "TestEnum")
429-
.click(attributeSelector.attributeClass)
424+
.typeText(selectors.input, "TestEnum", { replace: true })
430425
.doubleClick(attributeSelector.attributeClass)
431-
.typeText(selectors.input, "TestAttributeClass")
432-
.click(attributeSelector.attributeAbstract)
426+
.typeText(selectors.input, "TestAttributeClass", { replace: true })
433427
.doubleClick(attributeSelector.attributeAbstract)
434-
.typeText(selectors.input, "TestAttributeAbstract")
435-
.click(attributeSelector.attributeInterface)
428+
.typeText(selectors.input, "TestAttributeAbstract", { replace: true })
436429
.doubleClick(attributeSelector.attributeInterface)
437-
.typeText(selectors.input, "TestAttributeInterface")
438-
.click(attributeSelector.literalEnum)
430+
.typeText(selectors.input, "TestAttributeInterface", { replace: true })
439431
.doubleClick(attributeSelector.literalEnum)
440-
.typeText(selectors.input, "TestLiteralEnum")
441-
.click(nameClassRenamed)
432+
.typeText(selectors.input, "TestLiteralEnum", { replace: true })
433+
.click(selectors.svgCanvas)
442434
.expect(nameClassRenamed.exists).ok("Renamed Class")
443435
.expect(nameAbstractRenamed.exists).ok("Renamed Abstract")
444436
.expect(nameInterfaceRenamed.exists).ok("Renamed Interface")
@@ -457,13 +449,13 @@ test('Change Attributetype', async t => {
457449
await t
458450
.click(attributeSelector.attributeClass)
459451
.doubleClick(attributeSelector.attributeClass)
460-
.typeText(selectors.input, 'test : EDa')
452+
.typeText(selectors.input, 'test : EDa', { replace: true })
461453
.pressKey('ctrl+space')
462454
.pressKey('down')
463455
.pressKey('Enter')
464456
.expect(changedAttribute.exists).ok("Changing the attributetype via Autocompletion")
465457
.doubleClick(changedAttribute)
466-
.typeText(selectors.input, 'layout : EString')
458+
.typeText(selectors.input, 'layout : EString', { replace: true })
467459
.pressKey('Enter')
468460
.expect(changedAttributeWrite.exists).ok("Changing the attributetype via Typing");
469461
});
@@ -533,4 +525,4 @@ test('Delete Edges with DEL', async t => {
533525
.expect(edgeSelector.containmentEdge.exists).notOk('Containment deleted')
534526
.expect(edgeSelector.inheritanceEdge.exists).notOk('Inheritance deleted')
535527
.expect(edgeSelector.referenceEdge.exists).notOk('Reference deleted');
536-
});
528+
});

client/tests/workspace/testNodesWithAttributes.enotation

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
</elements>
99
<elements xsi:type="enotation:Shape">
1010
<semanticElement uri="//Abstract"/>
11-
<position x="8.0" y="134.0"/>
11+
<position x="11.0" y="99.0"/>
1212
<size width="270.109375" height="75.015625"/>
1313
</elements>
1414
<elements xsi:type="enotation:Shape">
1515
<semanticElement uri="//Interface"/>
16-
<position x="280.0" y="12.0"/>
16+
<position x="10.0" y="184.0"/>
1717
<size width="274.5625" height="75.015625"/>
1818
</elements>
1919
<elements xsi:type="enotation:Shape">
2020
<semanticElement uri="//Enum"/>
21-
<position x="310.015625" y="135.0"/>
21+
<position x="11.015625" y="268.0"/>
2222
<size width="146.71875" height="75.015625"/>
2323
</elements>
2424
</enotation:Diagram>

0 commit comments

Comments
 (0)