1 |
1e2b2c27
|
Tomáš Šimandl
|
*** Settings ***
|
2 |
|
|
Documentation A test suite with tests of vertex grouping functionality.
|
3 |
|
|
...
|
4 |
|
|
... This test has a workflow that is created using keywords in
|
5 |
|
|
... the imported resource file.
|
6 |
|
|
...
|
7 |
|
|
Suite Setup Open Browser To Demo Diagram
|
8 |
|
|
Test Setup Click Element //button[@id='vertexToGroup']
|
9 |
|
|
Test Teardown Reload Diagram Screen
|
10 |
|
|
Suite Teardown Close Browser
|
11 |
|
|
Resource common.robot
|
12 |
|
|
|
13 |
|
|
*** Variables ***
|
14 |
|
|
${zoomInButton} //button[@id='zoomIn']
|
15 |
|
|
|
16 |
|
|
${vertex5} //*[name()='svg'][contains(@class, 'vertex')][@data-id='5']
|
17 |
|
|
${vertex6} //*[name()='svg'][contains(@class, 'vertex')][@data-id='6']
|
18 |
|
|
|
19 |
|
|
${group1} //*[name()='svg'][contains(@class, 'group')][@data-id='1']
|
20 |
|
|
|
21 |
|
|
${groupName} /*[name()='text'][@class='group-name']
|
22 |
|
|
${groupVertexList} /*[name()='g'][@class='group-vertex-list']
|
23 |
|
|
${groupExpandButton} /*[name()='g'][contains(@class, 'expand-button')]
|
24 |
|
|
${groupCompressButton} /*[name()='g'][contains(@class, 'compress-button')]
|
25 |
|
|
${groupDissolveButton} /*[name()='g'][contains(@class, 'dissolve-button')]
|
26 |
|
|
|
27 |
|
|
${vertexContextMenu} //div[contains(@class, 'context-menu')]
|
28 |
|
|
|
29 |
|
|
*** Test Cases ***
|
30 |
|
|
Mouse Down Group
|
31 |
|
|
Mouse Down ${group1}
|
32 |
|
|
Element Should Have Class ${group1} node--dragged
|
33 |
|
|
Mouse Up ${group1}
|
34 |
|
|
Element Should Not Have Class ${group1} node--dragged
|
35 |
|
|
|
36 |
|
|
Drag Group
|
37 |
|
|
# zoom in to 100% to get correct coordinates
|
38 |
|
|
Click Element ${zoomInButton}
|
39 |
|
|
Click Element ${zoomInButton}
|
40 |
|
|
# get old group coordinates
|
41 |
|
|
${oldX}= Get Element Attribute ${group1} x
|
42 |
|
|
${oldX}= Convert To Number ${oldX} 2
|
43 |
|
|
${oldY}= Get Element Attribute ${group1} y
|
44 |
|
|
${oldY}= Convert To Number ${oldY} 2
|
45 |
|
|
# move vertex by 10 pixels in both directions
|
46 |
|
|
Drag And Drop By Offset ${group1} 10 10
|
47 |
|
|
# get new group coordinates
|
48 |
|
|
${newX}= Get Element Attribute ${group1} x
|
49 |
|
|
${newX}= Convert To Number ${newX} 2
|
50 |
|
|
${newY}= Get Element Attribute ${group1} y
|
51 |
|
|
${newY}= Convert To Number ${newY} 2
|
52 |
|
|
# check that offset matches
|
53 |
|
|
Should Be Equal As Numbers ${oldX + 10} ${newX}
|
54 |
|
|
Should Be Equal As Numbers ${oldY + 10} ${newY}
|
55 |
|
|
|
56 |
|
|
Rename Group
|
57 |
|
|
Element Should Contain ${group1}${groupName} Group 1
|
58 |
|
|
# trigger group rename prompt
|
59 |
|
|
Click Element ${group1}/*[name()='text']
|
60 |
|
|
Input Text Into Alert Lorem Ipsum
|
61 |
|
|
# check that group name was changed
|
62 |
|
|
Element Should Contain ${group1}${groupName} Lorem Ipsum
|
63 |
|
|
|
64 |
|
|
Expand And Compress Group
|
65 |
|
|
# expand group
|
66 |
|
|
Click Element ${group1}${groupExpandButton}
|
67 |
|
|
# check that group is expanded
|
68 |
|
|
Element Should Have Class ${group1} group--expanded
|
69 |
|
|
Element Should Not Be Visible ${group1}${groupExpandButton}
|
70 |
|
|
Element Should Be Visible ${group1}${groupCompressButton}
|
71 |
|
|
Element Should Be Visible ${group1}${groupVertexList}
|
72 |
|
|
# compress group
|
73 |
|
|
Click Element ${group1}${groupCompressButton}
|
74 |
|
|
# check that group is back to normal
|
75 |
|
|
Element Should Not Have Class ${group1} group--expanded
|
76 |
|
|
Element Should Be Visible ${group1}${groupExpandButton}
|
77 |
|
|
Element Should Not Be Visible ${group1}${groupCompressButton}
|
78 |
|
|
Element Should Not Be Visible ${group1}${groupVertexList}
|
79 |
|
|
|
80 |
|
|
Dissolve Group
|
81 |
|
|
Click Element ${group1}${groupDissolveButton}
|
82 |
|
|
# check that group is not visible while its vertex is
|
83 |
|
|
Element Should Not Be Visible ${group1}
|
84 |
|
|
Element Should Be Visible ${vertex6}
|
85 |
|
|
|
86 |
|
|
Add Vertex To Group
|
87 |
|
|
# open vertex context menu
|
88 |
|
|
Open Context Menu ${vertex5}
|
89 |
|
|
Element Should Be Visible ${vertexContextMenu}
|
90 |
|
|
# add vertex to group
|
91 |
|
|
Click Element ${vertexContextMenu}//li[1]
|
92 |
|
|
# check that neither vertex nor its context menu is visible
|
93 |
|
|
Element Should Not Be Visible ${vertexContextMenu}
|
94 |
|
|
Element Should Not Be Visible ${vertex5}
|
95 |
|
|
|
96 |
|
|
*** Keywords ***
|