Skip to content

Commit

Permalink
Added example relationship and diagram to e2e-tests example worspace.
Browse files Browse the repository at this point in the history
Added context menu tests on relationship and diagram files in the explorer view.
  • Loading branch information
harmen-xb committed Dec 8, 2023
1 parent 9d084d1 commit 4dcdc37
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diagram:
id: "Example-diagram"
name: "Example-diagram"
nodes:
- id: "ExampleEntityNode"
entity: "unknown/ExampleEntity"
x: 463.96875
y: 251
width: 152.28289794921875
height: 94
edges:
- id: "ExampleEntityToExampleEntity"
relationship: "unknown/ExampleEntityToExampleEntity"
sourceNode: "ExampleEntityNode"
targetNode: "ExampleEntityNode"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
relationship:
id: "ExampleEntityToExampleEntity"
parent: "ExampleEntity"
child: "ExampleEntity"
type: "1:1"
22 changes: 22 additions & 0 deletions e2e-tests/src/tests/crossmodel-explorer-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,26 @@ test.describe('CrossModel Explorer View', () => {
expect(await menu.menuItemByNamePath('Open With', 'Code Editor')).toBeDefined();
expect(await menu.menuItemByNamePath('Open With', 'Form Editor')).toBeDefined();
});

test('code and form editor options available in the context menu on a relationship', async () => {
const file = await explorer.getFileStatNodeByLabel('exanple-relationship.relationship.cm');
expect(file).toBeDefined();
expect(await file.label()).toBe('exanple-relationship.relationship.cm');
const menu = await file.openContextMenu();

Check failure on line 31 in e2e-tests/src/tests/crossmodel-explorer-view.spec.ts

View workflow job for this annotation

GitHub Actions / build-and-test / ubuntu-latest

crossmodel-explorer-view.spec.ts:27:8 › CrossModel Explorer View › code and form editor options available in the context menu on a relationship

1) crossmodel-explorer-view.spec.ts:27:8 › CrossModel Explorer View › code and form editor options available in the context menu on a relationship TimeoutError: elementHandle.click: Timeout 5000ms exceeded. =========================== logs =========================== attempting click action waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #1 waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #2 waiting 20ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #3 waiting 100ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #4 waiting 100ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #5 waiting 500ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #6 waiting 500ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #7 waiting 500ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #8 waiting 500ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #9 waiting 500ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #10 waiting 500ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #11 waiting 500ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <div tabindex="-1" class="p-Widget p-Menu">…</div> intercepts pointer events retrying click action, attempt #12 waiting 500ms waiting for element to be visible, enabled and stable element is visible, enabled and stable scrolling into view if needed done scrolling <di
expect(await menu.isOpen()).toBe(true);
// Expect the Code and Form editor to be in the Open With menu option.
expect(await menu.menuItemByNamePath('Open With', 'Code Editor')).toBeDefined();
expect(await menu.menuItemByNamePath('Open With', 'Form Editor')).toBeDefined();
});

test('code and diagram editor options available in the context menu on a diagram', async () => {
const file = await explorer.getFileStatNodeByLabel('example-diagram.diagram.cm');
expect(file).toBeDefined();
expect(await file.label()).toBe('example-diagram.diagram.cm');
const menu = await file.openContextMenu();
expect(await menu.isOpen()).toBe(true);
// Expect the Code and Form editor to be in the Open With menu option.
expect(await menu.menuItemByNamePath('Open With', 'Code Editor')).toBeDefined();
expect(await menu.menuItemByNamePath('Open With', 'CrossModel Diagram')).toBeDefined();
});
});

0 comments on commit 4dcdc37

Please sign in to comment.