1
|
*** Settings ***
|
2
|
Documentation A test suite with tests of node search.
|
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 Teardown Reload Diagram Screen
|
9
|
Suite Teardown Close Browser
|
10
|
Resource common.robot
|
11
|
|
12
|
*** Variables ***
|
13
|
${searchInputField} //input[@id='searchText']
|
14
|
${searchButton} //button[@id='search']
|
15
|
${searchCounter} //span[@id='countOfFound']
|
16
|
|
17
|
${vertex1} //*[name()='svg'][@data-id='1']
|
18
|
${vertex2} //*[name()='svg'][@data-id='2']
|
19
|
${vertex3} //*[name()='svg'][@data-id='3']
|
20
|
${vertex4} //*[name()='svg'][@data-id='4']
|
21
|
${vertex5} //*[name()='svg'][@data-id='5']
|
22
|
${vertex6} //*[name()='svg'][@data-id='6']
|
23
|
|
24
|
*** Test Cases ***
|
25
|
Search vertex using enter key
|
26
|
Input Text ${searchInputField} obcc-parking-example
|
27
|
# press enter
|
28
|
Press Key ${searchInputField} \\13
|
29
|
# check counter of found nodes
|
30
|
${found}= Get Text ${searchCounter}
|
31
|
Should Be Equal As Strings ${found} 4
|
32
|
# check CSS classes of (not) found nodes
|
33
|
Element Should Have Class ${vertex1} vertex--found
|
34
|
Element Should Have Class ${vertex2} vertex--found
|
35
|
Element Should Have Class ${vertex3} vertex--found
|
36
|
Element Should Have Class ${vertex5} vertex--found
|
37
|
Element Should Not Have Class ${vertex6} vertex--found
|
38
|
|
39
|
Search vertex using button
|
40
|
Input Text ${searchInputField} obcc-parking-example
|
41
|
Click Element ${searchButton}
|
42
|
# check counter of found nodes
|
43
|
${found}= Get Text ${searchCounter}
|
44
|
Should Be Equal As Strings ${found} 4
|
45
|
# check CSS classes of (not) found nodes
|
46
|
Element Should Have Class ${vertex1} vertex--found
|
47
|
Element Should Have Class ${vertex2} vertex--found
|
48
|
Element Should Have Class ${vertex3} vertex--found
|
49
|
Element Should Have Class ${vertex5} vertex--found
|
50
|
Element Should Not Have Class ${vertex6} vertex--found
|
51
|
|
52
|
Reset search using escape key
|
53
|
Input Text ${searchInputField} obcc-parking-example
|
54
|
Click Element ${searchButton}
|
55
|
# press escape
|
56
|
Press Key ${searchInputField} \\27
|
57
|
# check counter of found nodes
|
58
|
${found}= Get Text ${searchCounter}
|
59
|
Should Be Equal As Strings ${found} 0
|
60
|
# check that no nodes are found
|
61
|
Element Should Not Have Class ${vertex1} vertex--found
|
62
|
Element Should Not Have Class ${vertex2} vertex--found
|
63
|
Element Should Not Have Class ${vertex3} vertex--found
|
64
|
Element Should Not Have Class ${vertex5} vertex--found
|
65
|
Element Should Not Have Class ${vertex6} vertex--found
|
66
|
|
67
|
Reset search using counter click
|
68
|
Input Text ${searchInputField} obcc-parking-example
|
69
|
Click Element ${searchButton}
|
70
|
Click Element ${searchCounter}
|
71
|
# check counter of found nodes
|
72
|
${found}= Get Text ${searchCounter}
|
73
|
Should Be Equal As Strings ${found} 0
|
74
|
# check that no nodes are found
|
75
|
Element Should Not Have Class ${vertex1} vertex--found
|
76
|
Element Should Not Have Class ${vertex2} vertex--found
|
77
|
Element Should Not Have Class ${vertex3} vertex--found
|
78
|
Element Should Not Have Class ${vertex5} vertex--found
|
79
|
Element Should Not Have Class ${vertex6} vertex--found
|
80
|
|
81
|
*** Keywords ***
|