-
Notifications
You must be signed in to change notification settings - Fork 45
/
diagram-contextual-palette.cy.js
70 lines (65 loc) · 2.93 KB
/
diagram-contextual-palette.cy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*******************************************************************************
* Copyright (c) 2023 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
describe('/projects/:projectId/edit - Robot Diagram', () => {
beforeEach(() => {
cy.deleteAllProjects();
cy.createProject('Cypress Project').then((res) => {
const projectId = res.body.data.createProject.project.id;
const robot_flow_id = 'c26b6086-b444-3ee6-b8cd-9a4fde5956a7';
cy.createDocument(projectId, robot_flow_id, 'flow').then(() => {
cy.visit(`/projects/${projectId}/edit`);
});
});
cy.getByTestId('flow').dblclick();
cy.getByTestId('Robot').dblclick();
cy.getByTestId('Robot-more').click();
cy.getByTestId('treeitem-contextmenu').findByTestId('new-representation').click();
cy.getByTestId('name').clear();
cy.getByTestId('name').type('Topography');
cy.getByTestId('representationDescription').click();
cy.getByTestId('Topography with auto layout').click();
cy.getByTestId('create-representation').click();
cy.getByTestId('Topography').click();
});
it('test Hide/Fade action is not available on diagram background', () => {
cy.getByTestId('Rectangle - CaptureSubSystem').click();
cy.getByTestId('visibilitySection').should('exist');
cy.getByTestId('Diagram').click();
cy.getByTestId('visibilitySection').should('not.exist');
});
it('test default tool is updated', () => {
cy.getByTestId('Diagram').click(5, 5);
cy.getByTestId('Composite Processor - Tool').should('exist');
cy.getByTestId('Data Source - Tool').should('not.exist');
cy.getByTestId('expand').click();
cy.getByTestId('Composite Processor - Tool').should('exist');
cy.getByTestId('Data Source - Tool').should('exist');
cy.getByTestId('Data Source - Tool').click();
cy.getByTestId('Diagram').within(() => {
cy.getByTestId('Image - DataSource2').should('exist');
});
cy.getByTestId('Diagram').click(5, 5);
cy.getByTestId('Composite Processor - Tool').should('not.exist');
cy.getByTestId('Data Source - Tool').should('exist');
cy.getByTestId('expand').click();
cy.getByTestId('Composite Processor - Tool').should('exist');
cy.getByTestId('Data Source - Tool').should('exist');
cy.getByTestId('Composite Processor - Tool').click();
cy.getByTestId('Diagram').within(() => {
cy.getByTestId('Rectangle - Processor3').should('exist');
});
cy.getByTestId('Diagram').click(5, 5);
cy.getByTestId('Composite Processor - Tool').should('exist');
cy.getByTestId('Data Source - Tool').should('not.exist');
});
});