Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 9432fdc1

Přidáno uživatelem Patrik Harag před téměř 6 roky(ů)

Clean UI tests (#7266)

Zobrazit rozdíly:

sources/imiger-core/src/main/webapp/tests/README.html
1
<!DOCTYPE html><html><head><meta charset="utf-8"><title>README.md</title><script type="text/javascript">
2
//<![CDATA[
3
window.__cfRocketOptions = {byc:0,p:0,petok:"c53cad5b13ba49e5fc2df1f941c70af8296d137a-1525024313-1800"};
4
//]]>
5
</script>
6
<script type="text/javascript" src="https://ajax.cloudflare.com/cdn-cgi/scripts/935cb224/cloudflare-static/rocket.min.js"></script>
7
<style></style></head><body id="preview">
8
<h1><a id="UI_Tests_0"></a>UI Tests</h1>
9
<p>This folder contains a test suite for various UI interactions. Tests are written and run by <a href="http://robotframework.org">Robot Framework</a>.</p>
10
<h2><a id="How_to_Run_It_4"></a>How to Run It</h2>
11
<h3><a id="1_Install_pip_6"></a>1. Install pip</h3>
12
<p>pip is a Python package management system which can be used to install Robot Framework. Get it at <a href="https://pip.pypa.io/en/stable/quickstart/">https://pip.pypa.io/en/stable/quickstart/</a>.</p>
13
<h3><a id="2_Install_Robot_Framework_using_pip_10"></a>2. Install Robot Framework using pip</h3>
14
<p><code>pip install robotframework</code><br>
15
<code>pip install robotframework-selenium2library</code></p>
16
<h3><a id="3_Install_browser_controlling_driver_15"></a>3. Install browser controlling driver</h3>
17
<p>Tests written in Robot Framework have Selenium under cover. Selenium uses a headless browser to automatically interact with a webpage like a normal user would. For that, browser controller must be installed.</p>
18
<p>There are basically two options:</p>
19
<ol>
20
<li><a href="https://github.com/mozilla/geckodriver/releases">geckodriver</a></li>
21
<li><strong><a href="https://sites.google.com/a/chromium.org/chromedriver/downloads">chromedriver</a></strong> (default)</li>
22
</ol>
23
<p>You should put path to the driver folder to your <code>Path</code>. Obviously, you should have Firefox or Chrome installed too for geckodriver/chromedriver to work.</p>
24
<h3><a id="4_Run_Robot_Framework_25"></a>4. Run Robot Framework</h3>
25
<p>Assuming you have Python’s Scripts folder added to your <code>Path</code>, you should be able to run all test suits:</p>
26
<p><code>robot ./</code></p>
27
<p>To set a custom output folder, use option <code>--outputdir</code>:</p>
28
<p><code>robot --outputdir ./output ./</code></p>
29
<p>To run a single test suit, point to that file:</p>
30
<p><code>robot --outputdir ./output ./graph.robot</code></p>
31
<p>To run a particular test from a test suite, use option <code>--test</code>:</p>
32
<p><code>robot --outputdir ./output --test &quot;General&quot; ./graph.robot</code></p>
33
<h3><a id="5_Check_results_43"></a>5. Check results</h3>
34
<p>In your output folder (<code>./</code> by default), there should be a HTML file called <code>report.html</code>. It contains additional details about executed test runs.</p>
35

  
36
</body></html>
sources/imiger-core/src/main/webapp/tests/README.md
1
# UI Tests
2

  
3
This folder contains a test suite for various UI interactions. Tests are written and run by [Robot Framework](http://robotframework.org).
4

  
5
## How to Run It
6

  
7
### 1. Install pip
8

  
9
pip is a Python package management system which can be used to install Robot Framework. Get it at https://pip.pypa.io/en/stable/quickstart/.
10

  
11
### 2. Install Robot Framework using pip
12

  
13
`pip install robotframework`
14
`pip install robotframework-selenium2library`
15

  
16
### 3. Install browser controlling driver
17

  
18
Tests written in Robot Framework have Selenium under cover. Selenium uses a headless browser to automatically interact with a webpage like a normal user would. For that, browser controller must be installed.
19

  
20
There are basically two options:
21
1. [geckodriver](https://github.com/mozilla/geckodriver/releases)
22
2. **[chromedriver](https://sites.google.com/a/chromium.org/chromedriver/downloads)** (default)
23

  
24
You should put path to the driver folder to your `Path`. Obviously, you should have Firefox or Chrome installed too for geckodriver/chromedriver to work.
25

  
26
### 4. Run Robot Framework
27

  
28
Assuming you have Python's Scripts folder added to your `Path`, you should be able to run all test suits:
29

  
30
`robot ./`
31

  
32
To set a custom output folder, use option `--outputdir`:
33

  
34
`robot --outputdir ./output ./`
35

  
36
To run a single test suit, point to that file:
37

  
38
`robot --outputdir ./output ./graph.robot`
39

  
40
To run a particular test from a test suite, use option `--test`:
41

  
42
`robot --outputdir ./output --test "General" ./graph.robot`
43

  
44
### 5. Check results
45

  
46
In your output folder (`./` by default), there should be a HTML file called `report.html`. It contains additional details about executed test runs.
sources/imiger-core/src/main/webapp/tests/common.robot
1
*** Settings ***
2
Documentation	A resource file with reusable keywords and variables.
3

  
4
Library			SeleniumLibrary
5
Library			OperatingSystem
6
Library			String
7

  
8

  
9
*** Variables ***
10
${BROWSER}		Chrome
11
${DELAY}		0.1
12

  
13
${SERVER}			http://localhost:8080/imiger/
14
${TEST DATA PATH}	${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}data${/}
15

  
16
${UPLOAD FILES URL}	${SERVER}
17
${GRAPH URL}		${SERVER}/graph
18

  
19

  
20
*** Keywords ***
21
Open Browser To Base Path
22
	Open Browser		${UPLOAD FILES URL}		${BROWSER}
23
	Maximize Browser Window
24
	Set Selenium Speed	${DELAY}
25

  
26

  
27
Go To Upload Screen
28
	Go To				${UPLOAD FILES URL}
29

  
30

  
31
Open Diagram
32
	${filePath}=		Normalize Path		${TEST DATA PATH}SPADe JSONs${/}aswi2017mutant-industries-ltd.json
33
	Choose File				name:file		${filePath}
34
	Select Radio Button		fileFormat		-968839389
35
	Click Button			Start visualization
36
	Wait Until Element Is Not Visible		//div[@id="loader"]
37

  
38

  
39
Open Browser To Demo Diagram
40
	Open Browser To Base Path
41
	Click Element			//ul[@id="publicDiagramList"]/li[1]/a[text()="robot"]
42
	Wait Until Element Is Not Visible		//div[@id="loader"]
43

  
44

  
45
Open Browser To Diagram
46
	Open Browser To Base Path
47
	Open Diagram
48

  
49

  
50
Reload Diagram Screen
51
	Reload Page
52
	Wait Until Element Is Not Visible		//div[@id="loader"]
53

  
54

  
55
Element Should Have Class
56
	[Arguments]		${element}		${className}
57
	${element}=		Catenate	SEPARATOR=	${element}	[contains(@class,"		${className}	")]
58
	Page Should Contain Element		${element}
59

  
60

  
61
Element Should Not Have Class
62
	[Arguments]		${element}		${className}
63
	${element}=		Catenate	SEPARATOR=	${element}	[contains(@class,"		${className}	")]
64
	Page Should Not Contain Element	${element}
65

  
66

  
67
Element Should Have Attribute
68
	[Arguments]		${element}		${attributeName}
69
	${element}=		Catenate	SEPARATOR=	${element}	[@	${attributeName}	]
70
	Page Should Contain Element		${element}
71

  
72

  
73
Element Should Not Have Attribute
74
	[Arguments]		${element}		${attributeName}
75
	Element Attribute Value Should Be	${element}	${attributeName}	${None}
76

  
77

  
78
Get Element Coordinates
79
	[Arguments]		${element}
80
	${transformAttributeValue}=		Get Element Attribute	${element}	transform
81
	${matches}=		Get Regexp Matches		${transformAttributeValue}	([0-9\.-]+)
82
	[Return]		${matches}
sources/imiger-core/src/main/webapp/tests/edge.robot
1
*** Settings ***
2
Documentation	A test suite with tests of edge actions.
3

  
4
Suite Setup		Open Browser To Demo Diagram
5
Suite Teardown	Close Browser
6
Test Teardown	Reload Diagram Screen
7

  
8
Resource		common.robot
9

  
10

  
11
*** Variables ***
12
${edge38}		//*[name()="g"][contains(@class, "edge")][@data-id="38"]
13

  
14
${vertex4}		//*[name()="g"][contains(@class, "vertex")][@data-id="4"]
15
${vertex2014}	//*[name()="g"][contains(@class, "vertex")][@data-id="2014"]
16

  
17
${edgeArrow}	/*[name()="g"][contains(@class, "arrow")]
18

  
19
${edgePopover}	//div[contains(@class, "edge-popover")]
20

  
21

  
22
*** Test Cases ***
23
Highlight Edge
24
	Click Element	${edge38}${edgeArrow}
25
	# check that vertices not connected to the edge are not highlighted
26
	Element Should Have Class	${edge38}		edge--highlighted
27
	Element Should Have Class	${vertex4}		node--highlighted
28
	Element Should Have Class	${vertex2014}	node--highlighted
29

  
30

  
31
Hide Edge Popover By Moving Mouse Out
32
	Click Element		${edge38}${edgeArrow}
33
	Mouse Out			${edgePopover}
34
	Element Should Not Be Visible	${edgePopover}
35
	Element Should Have Attribute	${edgePopover}	hidden
36

  
37

  
38
Hide Edge Popover By Clicking Elsewhere
39
	Click Element		${edge38}${edgeArrow}
40
	Click Element		//body
41
	Element Should Not Be Visible	${edgePopover}
42
	Element Should Have Attribute	${edgePopover}	hidden
sources/imiger-core/src/main/webapp/tests/filter.robot
1
*** Settings ***
2
Documentation	A test suite with tests of node filtering.
3

  
4
Library			String
5

  
6
Suite Setup		Open Browser To Demo Diagram
7
Suite Teardown	Close Browser
8
Test Teardown	Reload Diagram Screen
9

  
10
Resource		common.robot
11

  
12

  
13
*** Variables ***
14
${filterButton}						//button[@id="filterButton"]
15
${filterModalWindow}				//div[contains(@class, "filter-modal")]
16
${filterModalWindowCloseButton}		${filterModalWindow}//button[contains(@class, "close-button")]
17

  
18
${baseFilterDropdown}				${filterModalWindow}//select[@name="baseFilter"]
19
${additionalFilterDropdown}			${filterModalWindow}//select[@name="additionalFilter"]
20
${operationDropdown}				${filterModalWindow}//select[@name="operation"]
21

  
22
${stringValueInput}					${filterModalWindow}//input[@name="value"]
23
${enumValueDropdown}				${filterModalWindow}//select[@name="value"]
24
${numberValueInput}					${filterModalWindow}//input[@name="value"]
25
${numberFromValueInput}				${filterModalWindow}//input[@name="value-from"]
26
${numberToValueInput}				${filterModalWindow}//input[@name="value-to"]
27
${dateValueInput}					${filterModalWindow}//input[@name="value"]
28
${dateFromValueInput}				${filterModalWindow}//input[@name="value-from"]
29
${dateToValueInput}					${filterModalWindow}//input[@name="value-to"]
30

  
31
${applyButton}						${filterModalWindow}//button[@type="submit"]
32
${resetButton}						${filterModalWindow}//button[@type="reset"]
33

  
34
${foundNodes}						//*[contains(@class, "node")][@filter="url(#node--found)"]
35

  
36

  
37
*** Test Cases ***
38
Open filter modal
39
	Click Button						${filterButton}
40
	Element Should Not Have Attribute	${filterModalWindow}	hidden
41

  
42

  
43
Close filter modal by button click
44
	Click Button					${filterButton}
45
	Click Button					${filterModalWindowCloseButton}
46
	Element Should Have Attribute	${filterModalWindow}	hidden
47

  
48

  
49
Close filter modal by backdrop click
50
	Click Button					${filterButton}
51
	Click Element At Coordinates	${filterModalWindow}	221		0
52
	Element Should Have Attribute	${filterModalWindow}	hidden
53

  
54

  
55
Focus form fields
56
	Click Button					${filterButton}
57
	Click Element					${filterModalWindow}//label[@for="baseFilter"]
58
	Element Should Be Focused		${baseFilterDropdown}
59
	Click Element					${filterModalWindow}//label[@for="operation"]
60
	Element Should Be Focused		${operationDropdown}
61

  
62

  
63
Reset form
64
	Click Button					${filterButton}
65
	Select From List By Label		${enumValueDropdown}	Vertex
66
	Click Button					${applyButton}
67
	Click Button					${resetButton}
68
	${values}=			Get Selected List Labels	${enumValueDropdown}
69
	Should Be Empty					${values}
70
	${count}=			Get Element Count	${foundNodes}
71
	Should Be Equal As Integers		${count}	0
72

  
73

  
74
Check defaults
75
	Click Button					${filterButton}
76
	${baseFilterValue}=	Get Selected List Label		${baseFilterDropdown}
77
	Should Be Equal As Strings		${baseFilterValue}		Node type
78
	Element Should Have Attribute	${additionalFilterDropdown}		hidden
79
	${operationValue}=	Get Selected List Label		${operationDropdown}
80
	Should Be Equal As Strings		${operationValue}		equals
81
	${values}=			Get Selected List Labels	${enumValueDropdown}
82
	Should Be Empty					${values}
83

  
84

  
85
Filter by node type equals
86
	[Tags]		filter-by-node-type
87
	Click Button					${filterButton}
88
	Select From List By Label		${operationDropdown}	equals
89
	Select From List By Label		${enumValueDropdown}	Vertex
90
	Click Button					${applyButton}
91
	${count}=			Get Element Count	${foundNodes}
92
	Should Be Equal As Integers		${count}	36
93

  
94

  
95
Filter by node type not equals
96
	[Tags]		filter-by-node-type
97
	Click Button					${filterButton}
98
	Select From List By Label		${operationDropdown}	not equals
99
	Select From List By Label		${enumValueDropdown}	Vertex
100
	Click Button					${applyButton}
101
	${count}=			Get Element Count	${foundNodes}
102
	Should Be Equal As Integers		${count}	1
103

  
104

  
105
Filter by vertex archetype equals
106
	[Tags]		filter-by-vertex-archetype
107
	Click Button					${filterButton}
108
	Select From List By Label		${baseFilterDropdown}	Vertex archetype
109
	Select From List By Label		${operationDropdown}	equals
110
	Select From List By Label		${enumValueDropdown}	Person
111
	Click Button					${applyButton}
112
	Found Count Should Be Equal		4
113

  
114

  
115
Filter by vertex archetype not equals
116
	[Tags]		filter-by-vertex-archetype
117
	Click Button					${filterButton}
118
	Select From List By Label		${baseFilterDropdown}	Vertex archetype
119
	Select From List By Label		${operationDropdown}	not equals
120
	Select From List By Label		${enumValueDropdown}	Person
121
	Click Button					${applyButton}
122
	Found Count Should Be Equal		32
123

  
124

  
125
Filter by string vertex attribute equals
126
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-string-attribute
127
	Click Button					${filterButton}
128
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
129
	Select From List By Label		${additionalFilterDropdown}		Name (string)
130
	Select From List By Label		${operationDropdown}	equals
131
	Input Text						${stringValueInput}		Stakeholders
132
	Click Button					${applyButton}
133
	Found Count Should Be Equal		1
134

  
135

  
136
Filter by string vertex attribute contains
137
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-string-attribute
138
	Click Button					${filterButton}
139
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
140
	Select From List By Label		${additionalFilterDropdown}		Name (string)
141
	Select From List By Label		${operationDropdown}	contains
142
	Input Text						${stringValueInput}		mentor
143
	Click Button					${applyButton}
144
	Found Count Should Be Equal		2
145

  
146

  
147
Filter by string vertex attribute starts with
148
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-string-attribute
149
	Click Button					${filterButton}
150
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
151
	Select From List By Label		${additionalFilterDropdown}		Name (string)
152
	Select From List By Label		${operationDropdown}	starts with
153
	Input Text						${stringValueInput}		Product
154
	Click Button					${applyButton}
155
	Found Count Should Be Equal		2
156

  
157

  
158
Filter by string vertex attribute ends with
159
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-string-attribute
160
	Click Button					${filterButton}
161
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
162
	Select From List By Label		${additionalFilterDropdown}		Name (string)
163
	Select From List By Label		${operationDropdown}	ends with
164
	Input Text						${stringValueInput}		projektu
165
	Click Button					${applyButton}
166
	Found Count Should Be Equal		2
167

  
168

  
169
Filter by string vertex attribute matches
170
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-string-attribute
171
	Click Button					${filterButton}
172
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
173
	Select From List By Label		${additionalFilterDropdown}		Name (string)
174
	Select From List By Label		${operationDropdown}	regular expression
175
	Input Text						${stringValueInput}		\\d+
176
	Click Button					${applyButton}
177
	Found Count Should Be Equal		4
178

  
179

  
180
Filter by enum vertex attribute equals
181
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-enum-attribute
182
	Click Button					${filterButton}
183
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
184
	Select From List By Label		${additionalFilterDropdown}		Roles (enum)
185
	Select From List By Label		${operationDropdown}	equals
186
	Select From List By Label		${enumValueDropdown}	Developer
187
	Click Button					${applyButton}
188
	Found Count Should Be Equal		3
189

  
190

  
191
Filter by enum vertex attribute not equals
192
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-enum-attribute
193
	Click Button					${filterButton}
194
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
195
	Select From List By Label		${additionalFilterDropdown}		Roles (enum)
196
	Select From List By Label		${operationDropdown}	not equals
197
	Select From List By Label		${enumValueDropdown}	Team leader
198
	Click Button					${applyButton}
199
	Found Count Should Be Equal		3
200

  
201

  
202
Filter by date vertex attribute equals
203
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-date-attribute
204
	Click Button					${filterButton}
205
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
206
	Select From List By Label		${additionalFilterDropdown}		Created (date)
207
	Select From List By Label		${operationDropdown}	equals
208
	Input Date						${dateValueInput}		2017-03-27
209
	Click Button					${applyButton}
210
	Found Count Should Be Equal		5
211

  
212

  
213
Filter by date vertex attribute not equals
214
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-date-attribute
215
	Click Button					${filterButton}
216
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
217
	Select From List By Label		${additionalFilterDropdown}		Created (date)
218
	Select From List By Label		${operationDropdown}	not equals
219
	Input Date						${dateValueInput}		2017-03-27
220
	Click Button					${applyButton}
221
	Found Count Should Be Equal		27
222

  
223

  
224
Filter by date vertex attribute from unix epoch to date
225
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-date-attribute
226
	Click Button					${filterButton}
227
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
228
	Select From List By Label		${additionalFilterDropdown}		Created (date)
229
	Select From List By Label		${operationDropdown}	is in range
230
	Input Date						${dateToValueInput}		2017-04-01
231
	Click Button					${applyButton}
232
	Found Count Should Be Equal		6
233

  
234

  
235
Filter by date vertex attribute is in range
236
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-date-attribute
237
	Click Button					${filterButton}
238
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
239
	Select From List By Label		${additionalFilterDropdown}		Created (date)
240
	Select From List By Label		${operationDropdown}	is in range
241
	Input Date						${dateFromValueInput}	2017-04-01
242
	Input Date						${dateToValueInput}		2017-05-01
243
	Click Button					${applyButton}
244
	Found Count Should Be Equal		22
245

  
246

  
247
Filter by date vertex attribute is from date to now
248
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-date-attribute
249
	Click Button					${filterButton}
250
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
251
	Select From List By Label		${additionalFilterDropdown}		Created (date)
252
	Select From List By Label		${operationDropdown}	is in range
253
	Input Date						${dateFromValueInput}	2017-05-01
254
	Click Button					${applyButton}
255
	Found Count Should Be Equal		4
256

  
257

  
258
Filter by number vertex attribute equals
259
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
260
	Click Button					${filterButton}
261
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
262
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
263
	Select From List By Label		${operationDropdown}	equals
264
	Input Text						${numberValueInput}		40
265
	Click Button					${applyButton}
266
	Found Count Should Be Equal		1
267

  
268

  
269
Filter by number vertex attribute not equals
270
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
271
	Click Button					${filterButton}
272
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
273
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
274
	Select From List By Label		${operationDropdown}	not equals
275
	Input Text						${numberValueInput}		40
276
	Click Button					${applyButton}
277
	Found Count Should Be Equal		0
278

  
279

  
280
Filter by number vertex attribute lower than
281
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
282
	Click Button					${filterButton}
283
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
284
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
285
	Select From List By Label		${operationDropdown}	lower than
286
	Input Text						${numberValueInput}		40
287
	Click Button					${applyButton}
288
	Found Count Should Be Equal		0
289

  
290

  
291
Filter by number vertex attribute lower than or equals
292
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
293
	Click Button					${filterButton}
294
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
295
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
296
	Select From List By Label		${operationDropdown}	lower than or equals
297
	Input Text						${numberValueInput}		40
298
	Click Button					${applyButton}
299
	Found Count Should Be Equal		1
300

  
301

  
302
Filter by number vertex attribute greater than
303
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
304
	Click Button					${filterButton}
305
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
306
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
307
	Select From List By Label		${operationDropdown}	greater than
308
	Input Text						${numberValueInput}		40
309
	Click Button					${applyButton}
310
	Found Count Should Be Equal		0
311

  
312

  
313
Filter by number vertex attribute greater than or equals
314
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
315
	Click Button					${filterButton}
316
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
317
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
318
	Select From List By Label		${operationDropdown}	greater than or equals
319
	Input Text						${numberValueInput}		40
320
	Click Button					${applyButton}
321
	Found Count Should Be Equal		1
322

  
323

  
324
Filter by number vertex attribute is from min to number
325
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
326
	Click Button					${filterButton}
327
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
328
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
329
	Select From List By Label		${operationDropdown}	is in range
330
	Input Text						${numberToValueInput}	30
331
	Click Button					${applyButton}
332
	Found Count Should Be Equal		0
333

  
334

  
335
Filter by number vertex attribute is in range
336
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
337
	Click Button					${filterButton}
338
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
339
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
340
	Select From List By Label		${operationDropdown}	is in range
341
	Input Text						${numberFromValueInput}	30
342
	Input Text						${numberToValueInput}	50
343
	Click Button					${applyButton}
344
	Found Count Should Be Equal		1
345

  
346

  
347
Filter by number vertex attribute is from number to max
348
	[Tags]		filter-by-vertex-attribute		filter-by-vertex-number-attribute
349
	Click Button					${filterButton}
350
	Select From List By Label		${baseFilterDropdown}	Vertex attribute
351
	Select From List By Label		${additionalFilterDropdown}		Progress (number)
352
	Select From List By Label		${operationDropdown}	is in range
353
	Input Text						${numberFromValueInput}	50
354
	Click Button					${applyButton}
355
	Found Count Should Be Equal		0
356

  
357

  
358
*** Keywords ***
359
Found Count Should Be Equal
360
	[Arguments]		${expectedCount}
361
	${count}=	Get Element Count	${foundNodes}
362
	Should Be Equal As Integers		${count}	${expectedCount}
363

  
364

  
365
Input Date
366
	[Arguments]		${locator}		${date}
367
	# split date to parts (day, month, year)
368
	@{parts}=		Split String	${date}		-
369
	# enter individual parts into the input
370
	Set Focus To Element			${locator}
371
	Press Key						${locator}		@{parts}[2]
372
	Press Key						${locator}		@{parts}[1]
373
	Press Key						${locator}		@{parts}[0]
sources/imiger-core/src/main/webapp/tests/graph.robot
1
*** Settings ***
2
Documentation	A test suite with tests of graph construction.
3

  
4
Suite Setup		Open Browser To Diagram
5
Suite Teardown	Close Browser
6

  
7
Resource		common.robot
8

  
9

  
10
*** Variables ***
11
${graphWrapper}			//*[name()="g"][@id="graph"]
12
${unconnectedNodeList}	//div[@id="unconnectedNodeListComponent"]
13
${componentCounter}		//span[@class="component-counter"]
14

  
15
${vertex2}				//*[name()="g"][contains(@class, "vertex")][@data-id="2"]
16
${vertex4}				//*[name()="g"][contains(@class, "vertex")][@data-id="4"]
17
${vertex291}			//*[name()="g"][contains(@class, "vertex")][@data-id="291"]
18
${vertex303}			//*[name()="g"][contains(@class, "vertex")][@data-id="303"]
19

  
20
${vertex0}				//*[name()="li"][contains(@class, "vertex")][@data-id="0"]
21
${vertex6}				//*[name()="li"][contains(@class, "vertex")][@data-id="6"]
22

  
23
*** Test Cases ***
24
General
25
	Title Should Be			IMiGEr - aswi2017mutant-industries-ltd.json
26
	# check component counter
27
	${count}=	Get Text	${componentCounter}
28
	Should Be Equal As Strings		${count}	loaded components: 19
29
	# check vertices that should be contained in viewport
30
	Page Should Contain Element		${graphWrapper}${vertex2}
31
	Page Should Contain Element		${graphWrapper}${vertex4}
32
	Page Should Contain Element		${graphWrapper}${vertex291}
33
	Page Should Contain Element		${graphWrapper}${vertex303}
34
	# check vertices that should be contained in unconnected node list
35
	Page Should Contain Element		${unconnectedNodeList}${vertex0}
36
	Page Should Contain Element		${unconnectedNodeList}${vertex6}
sources/imiger-core/src/main/webapp/tests/group.robot
1
*** Settings ***
2
Documentation	A test suite with tests of vertex grouping functionality.
3

  
4
Suite Setup		Open Browser To Demo Diagram
5
Suite Teardown	Close Browser
6
Test Setup		Click Element	//button[@id="vertexToGroup"]
7
Test Teardown	Reload Diagram Screen
8

  
9
Resource		common.robot
10

  
11

  
12
*** Variables ***
13
${zoomInButton}		//button[@id="zoomIn"]
14

  
15
${vertex2014}		//*[name()="g"][contains(@class, "vertex")][@data-id="2014"]
16
${vertex2019}		//*[name()="g"][contains(@class, "vertex")][@data-id="2019"]
17

  
18
${group1}			//*[name()="g"][contains(@class, "group")][@data-id="1"]
19

  
20
${groupName}			//span[@class="group-name"]
21

  
22
${vertexContextMenu}	//div[contains(@class, "context-menu")]
23

  
24

  
25
*** Test Cases ***
26
Mouse Down Group
27
	Mouse Down		${group1}
28
	Element Should Have Class		${group1}	node--dragged
29
	Mouse Up		${group1}
30
	Element Should Not Have Class	${group1}	node--dragged
31

  
32

  
33
Drag Group
34
	# zoom in to 100% to get correct coordinates
35
	Click Element	${zoomInButton}
36
	Click Element	${zoomInButton}
37
	# get old group coordinates
38
	${oldCoords}=	Get Element Coordinates		${group1}
39
	${oldX}=	Convert To Number		${oldCoords}[0]		2
40
	${oldY}=	Convert To Number		${oldCoords}[1]		2
41
	# move vertex by 10 pixels in both directions
42
	Drag And Drop By Offset				${group1}	10	10
43
	# get new group coordinates
44
	${newCoords}=	Get Element Coordinates		${group1}
45
	${newX}=	Convert To Number		${newCoords}[0]		2
46
	${newY}=	Convert To Number		${newCoords}[1]		2
47
	# check that offset matches
48
	Should Be Equal As Numbers			${oldX + 10}	${newX}
49
	Should Be Equal As Numbers			${oldY + 10}	${newY}
50

  
51

  
52
Rename Group
53
	Element Should Contain			${group1}${groupName}	File
54
	# trigger group rename prompt
55
	Click Element					${group1}${groupName}
56
	Input Text Into Alert			Lorem Ipsum
57
	# check that group name was changed
58
	Element Should Contain			${group1}${groupName}	Lorem Ipsum
59

  
60

  
61
Add Vertex To Group
62
	# open vertex context menu
63
	Open Context Menu				${vertex2014}
64
	Element Should Be Visible		${vertexContextMenu}
65
	# add vertex to group
66
	Click Element					${vertexContextMenu}//li[1]
67
	# check that neither vertex nor its context menu is visible
68
	Element Should Not Be Visible	${vertexContextMenu}
69
	Element Should Not Be Visible	${vertex2014}
sources/imiger-core/src/main/webapp/tests/navbar.robot
1
*** Settings ***
2
Documentation	A test suite with tests of navbar actions.
3

  
4
Suite Setup		Open Browser To Demo Diagram
5
Suite Teardown	Close Browser
6
Test Teardown	Reload Diagram Screen
7

  
8
Resource		common.robot
9

  
10

  
11
*** Variables ***
12
${navbar}				//div[@class="navbar"]
13
${graphWrapper}			//*[name()="g"][@id="graph"]
14

  
15
${mostEdgeButton}		//button[@id="mostEdge"]
16
${vertexToGroupButton}	//button[@id="vertexToGroup"]
17
${backToUploadButton}	//a[@id="backToUpload"]
18

  
19
${excludedNodeList}		//div[@id="excludedNodeListComponent"]
20

  
21
${group1}				//*[name()="g"][contains(@class, "group")][@data-id="1"]
22
${vertex2044}			//*[name()="g"][contains(@class, "vertex")][@data-id="2044"]
23
${excludedVertex2044}	//li[contains(@class, "vertex")][@data-id="2044"]
24

  
25

  
26
*** Test Cases ***
27
Exclude Vertex With Most Edges
28
	Click Element		${mostEdgeButton}
29
	# vertex with most edges should be excluded
30
	Page Should Not Contain Element	${graphWrapper}${vertex2044}
31
	Page Should Contain Element		${excludedNodeList}${excludedVertex2044}
32

  
33

  
34
Exclude Vertex With Most Edges To Group
35
	Click Element		${vertexToGroupButton}
36
	# vertex with most edges should be in a group
37
	Page Should Not Contain Element	${graphWrapper}${vertex2044}
38
	Page Should Contain Element		${graphWrapper}${group1}
39

  
40

  
41
Back To Upload
42
	Click Element		${backToUploadButton}
43
	${location}=		Get Location
44
	Should Be Equal As Strings		${location}		${UPLOAD FILES URL}
sources/imiger-core/src/main/webapp/tests/node-excluding.robot
1
*** Settings ***
2
Documentation	A test suite with tests of node excluding functionality.
3

  
4
Suite Setup		Open Browser To Demo Diagram
5
Suite Teardown	Close Browser
6
Test Setup		Select Radio Button		mode	exclude
7
Test Teardown	Reload Diagram Screen
8

  
9
Resource		common.robot
10

  
11

  
12
*** Variables ***
13
${vertexToGroupButton}	//button[@id="vertexToGroup"]
14

  
15
${excludedNodeList}		//div[@id="excludedNodeListComponent"]
16

  
17
${includeAllButton}		//button[contains(@class, "include-all-button")]
18

  
19
${vertex2013}			//*[name()="g"][contains(@class, "vertex")][@data-id="2013"]
20
${excludedVertex2013}	//li[contains(@class, "vertex")][@data-id="2013"]
21
${vertex2014}			//*[name()="g"][contains(@class, "vertex")][@data-id="2014"]
22
${excludedVertex2014}	//li[contains(@class, "vertex")][@data-id="2014"]
23

  
24
${group1}				//*[name()="g"][contains(@class, "group")][@data-id="1"]
25
${excludedGroup1}		//li[contains(@class, "group")][@data-id="1"]
26

  
27

  
28
*** Test Cases ***
29
Exclude Vertex
30
	Click Element		${vertex2014}
31
	Element Should Not Be Visible	${vertex2014}
32
	Element Should Be Visible		${excludedNodeList}${excludedVertex2014}
33

  
34

  
35
Exclude Group
36
	Click Element		${vertexToGroupButton}
37
	Click Element		${group1}
38
	Element Should Not Be Visible	${group1}
39
	Element Should Be Visible		${excludedNodeList}${excludedGroup1}
40

  
41

  
42
Include All Excluded Nodes
43
	Click Element		${vertex2013}
44
	Click Element		${vertex2014}
45
	Click Element		${excludedNodeList}${includeAllButton}
46
	Element Should Be Visible		${vertex2013}
47
	Element Should Not Be Visible	${excludedNodeList}${excludedVertex2013}
48
	Element Should Be Visible		${vertex2014}
49
	Element Should Not Be Visible	${excludedNodeList}${excludedVertex2014}
sources/imiger-core/src/main/webapp/tests/search.robot
1
*** Settings ***
2
Documentation	A test suite with tests of node search.
3

  
4
Suite Setup		Open Browser To Demo Diagram
5
Suite Teardown	Close Browser
6
Test Teardown	Reload Diagram Screen
7

  
8
Resource		common.robot
9

  
10

  
11
*** Variables ***
12
${searchInputField}	//input[@id="searchText"]
13
${searchButton}		//button[@id="searchButton"]
14
${searchCounter}	//span[@id="searchCount"]
15

  
16
${vertex2015}		//*[contains(@class, "vertex")][@data-id="2015"]
17
${vertex2039}		//*[contains(@class, "vertex")][@data-id="2039"]
18

  
19

  
20
*** Test Cases ***
21
Search vertex using enter key
22
	Input Text			${searchInputField}		Product
23
	# press enter
24
	Press Key			${searchInputField}		\\13
25
	# check counter of found nodes
26
	${found}=		Get Text	${searchCounter}
27
	Should Be Equal As Strings	${found}		2
28
	# check found nodes
29
	Element Attribute Value Should Be	${vertex2015}	filter	url(#node--found)
30
	Element Attribute Value Should Be	${vertex2039}	filter	url(#node--found)
31

  
32

  
33
Search vertex using button
34
	Input Text			${searchInputField}		Product
35
	Click Element		${searchButton}
36
	# check counter of found nodes
37
	${found}=	Get Text		${searchCounter}
38
	Should Be Equal As Strings	${found}		2
39
	# check found nodes
40
	Element Attribute Value Should Be	${vertex2015}	filter	url(#node--found)
41
	Element Attribute Value Should Be	${vertex2039}	filter	url(#node--found)
42

  
43

  
44
Reset search using escape key
45
	Input Text				${searchInputField}	Product
46
	Click Element			${searchButton}
47
	# press escape
48
	Press Key				${searchInputField}	\\27
49
	# check counter of found nodes
50
	${found}=	Get Text	${searchCounter}
51
	Should Be Equal As Strings	${found}		0
52
	# check that no nodes are found
53
	Element Should Not Have Attribute	${vertex2015}	filter
54
	Element Should Not Have Attribute	${vertex2039}	filter
55

  
56

  
57
Reset search using counter click
58
	Input Text				${searchInputField}	Product
59
	Click Element			${searchButton}
60
	Click Element			${searchCounter}
61
	# check counter of found nodes
62
	${found}=	Get Text	${searchCounter}
63
	Should Be Equal As Strings	${found}		0
64
	# check that no nodes are found
65
	Element Should Not Have Attribute	${vertex2015}	filter
66
	Element Should Not Have Attribute	${vertex2039}	filter
sources/imiger-core/src/main/webapp/tests/sidebar.robot
1
*** Settings ***
2
Documentation	A test suite with tests of sidebar panels toggling.
3

  
4
Suite Setup		Open Browser To Demo Diagram
5
Suite Teardown	Close Browser
6

  
7
Resource		common.robot
8

  
9

  
10
*** Variables ***
11
${sidebar}				//div[@id="sidebar"]
12

  
13
${unconnectedNodeList}	//div[@id="unconnectedNodeListComponent"]
14

  
15
${includeAllButton}		//button[contains(@class, "include-all-button")]
16
${excludeAllButton}		//button[contains(@class, "exclude-all-button")]
17

  
18
${vertex2030}			//*[name()="g"][contains(@class, "vertex")][@data-id="2030"]
19
${excludedVertex2030}	//li[contains(@class, "vertex")][@data-id="2030"]
20

  
21

  
22
*** Test Cases ***
23
Toggle Unconnected Nodes
24
	Element Should Not Have Attribute	${unconnectedNodeList}/div[@class="node-container-content"]		hidden
25
	Click Element						${unconnectedNodeList}/h2[@class="node-container-title"]
26
	Element Should Have Attribute		${unconnectedNodeList}/div[@class="node-container-content"]		hidden
27
	Click Element						${unconnectedNodeList}/h2[@class="node-container-title"]
28
	Element Should Not Have Attribute	${unconnectedNodeList}/div[@class="node-container-content"]		hidden
29

  
30

  
31
Include And Exclude All Unconnected Vertices
32
	Element Should Not Be Visible	${vertex2030}
33
	Element Should Be Visible		${unconnectedNodeList}${excludedVertex2030}
34
	# include all unconnected vertices
35
	Click Element					${unconnectedNodeList}${includeAllButton}
36
	Element Should Be Visible		${vertex2030}
37
	Element Should Not Be Visible	${unconnectedNodeList}${excludedVertex2030}
38
	# exclude all unconnected vertices
39
	Click Element					${unconnectedNodeList}${excludeAllButton}
40
	Element Should Not Be Visible	${vertex2030}
41
	Element Should Be Visible		${unconnectedNodeList}${excludedVertex2030}
sources/imiger-core/src/main/webapp/tests/vertex.robot
1
*** Settings ***
2
Documentation	A test suite with tests of vertex actions.
3

  
4
Suite Setup		Open Browser To Demo Diagram
5
Suite Teardown	Close Browser
6

  
7
Resource		common.robot
8

  
9

  
10
*** Variables ***
11
${zoomInButton}			//button[@id="zoomIn"]
12

  
13
${vertex9}				//*[name()="g"][contains(@class, "vertex")][@data-id="9"]
14
${vertex58}				//*[name()="g"][contains(@class, "vertex")][@data-id="58"]
15
${vertex2014}			//*[name()="g"][contains(@class, "vertex")][@data-id="2014"]
16

  
17
${vertexArchetypeIcon}	/*[name()="use"][@class="archetype-icon"]
18

  
19
${vertexPopover}		//div[contains(@class, "vertex-popover")]
20

  
21

  
22
*** Test Cases ***
23
Highlight Vertex
24
	Click Element					${vertex58}
25
	# check that other vertices are either highlighted or dimmed
26
	Element Should Have Class		${vertex9}		node--highlighted-as-required
27
	Element Should Have Class		${vertex58}		node--highlighted
28
	Element Should Have Class		${vertex2014}	node--dimmed
29
	# unhighlight
30
	Click Element					${vertex58}
31
	# check that other vertices are back to normal
32
	Element Should Not Have Class	${vertex9}		node--highlighted-as-required
33
	Element Should Not Have Class	${vertex58}		node--highlighted
34
	Element Should Not Have Class	${vertex2014}	node--dimmed
35

  
36

  
37
Mouse Down Vertex
38
	Mouse Down						${vertex2014}
39
	Element Should Have Class		${vertex2014}	node--dragged
40
	Mouse Up						${vertex2014}
41
	Element Should Not Have Class	${vertex2014}	node--dragged
42

  
43

  
44
Drag Vertex
45
	# zoom in to 100% to get correct coordinates
46
	Click Element		${zoomInButton}
47
	Click Element		${zoomInButton}
48
	# get old vertex coordinates
49
	${oldCoords}=	Get Element Coordinates		${vertex2014}
50
	${oldX}=	Convert To Number		${oldCoords}[0]		2
51
	${oldY}=	Convert To Number		${oldCoords}[1]		2
52
	# move vertex by 10 pixels in both directions
53
	Drag And Drop By Offset				${vertex2014}	10	10
54
	# get new vertex coordinates
55
	${newCoords}=	Get Element Coordinates		${vertex2014}
56
	${newX}=	Convert To Number		${newCoords}[0]		2
57
	${newY}=	Convert To Number		${newCoords}[1]		2
58
	# check that offset matches
59
	Should Be Equal As Numbers			${oldX + 10}	${newX}
60
	Should Be Equal As Numbers			${oldY + 10}	${newY}
61

  
62

  
63
Display Vertex Popover
64
	Click Element		${vertex2014}${vertexArchetypeIcon}
65
	Element Should Be Visible			${vertexPopover}
66
	Element Should Not Have Attribute	${vertexPopover}	hidden
67
	Mouse Out			${vertexPopover}
68

  
69

  
70
Hide Vertex Popover By Moving Mouse Out
71
	Click Element		${vertex2014}${vertexArchetypeIcon}
72
	Mouse Out			${vertexPopover}
73
	Element Should Not Be Visible	${vertexPopover}
74
	Element Should Have Attribute	${vertexPopover}	hidden
75

  
76

  
77
Hide Vertex Popover By Clicking Elsewhere
78
	Click Element		${vertex2014}${vertexArchetypeIcon}
79
	Click Element		//body
80
	Element Should Not Be Visible	${vertexPopover}
81
	Element Should Have Attribute	${vertexPopover}	hidden
sources/imiger-core/src/main/webapp/tests/zoom.robot
1
*** Settings ***
2
Documentation	A test suite with tests of graph zoom.
3

  
4
Library			String
5

  
6
Suite Setup		Open Browser To Demo Diagram
7
Suite Teardown	Close Browser
8
Test Teardown	Reload Diagram Screen
9

  
10
Resource		common.robot
11

  
12

  
13
*** Variables ***
14
${defaultZoom}		${80}
15
${minZoom}			${10}
16
${maxZoom}			${500}
17

  
18
${graphWrapper}		//*[name()="g"][@id="graph"]
19

  
20
${zoomInButton}		//button[@id="zoomIn"]
21
${zoomOutButton}	//button[@id="zoomOut"]
22
${zoomValue}		//span[@id="zoomValue"]
23

  
24

  
25
*** Test Cases ***
26
Zoom In
27
	Click Element		${zoomInButton}
28
	Zoom Should Be Equal	${defaultZoom + 10}
29

  
30

  
31
Zoom In Constraint
32
	# zoom in to maximum (there are 12 steps between default and maximum zoom level)
33
	Repeat Keyword	12	Click Element	${zoomInButton}
34
	Zoom Should Be Equal	${maxZoom}
35
	Element Should Have Class	${zoomInButton}	disabled
36

  
37

  
38
Zoom Out
39
	Click Element		${zoomOutButton}
40
	Zoom Should Be Equal	${defaultZoom - 10}
41

  
42

  
43
Zoom Out Constraint
44
	# zoom out to minimum (there are 5 steps between default and minimum zoom level)
45
	Repeat Keyword	5	Click Element	${zoomOutButton}
46
	Zoom Should Be Equal	${minZoom}
47
	Element Should Have Class	${zoomOutButton}	disabled
48

  
49

  
50
*** Keywords ***
51
Zoom Should Be Equal
52
	[Arguments]	${expectedScale}
53
	# check zoom scale text
54
	${scalePercentage}=	Get Text	${zoomValue}
55
	${expectedPercentage}=	Catenate	SEPARATOR=	${expectedScale}	%
56
	Should Be Equal As Strings	${scalePercentage}	${expectedPercentage}
57
	# check zoom scale attribute
58
	${expectedScaleAsString}=	Convert To String	${expectedScale / 100}
59
	${expectedScaleAsString}=	Replace String	${expectedScaleAsString}	.0	${EMPTY}
60
	${scaleAttribute}=	Get Element Attribute	${graphWrapper}	transform
61
	${expectedAttribute}=	Catenate	SEPARATOR=	scale(	${expectedScaleAsString}	)
62
	Should Be Equal As Strings	${scaleAttribute}	${expectedAttribute}
sources/imiger-core/src/test/robot/README.md
1
# UI Tests
2

  
3
This folder contains a test suite for various UI interactions. Tests are written and run by [Robot Framework](http://robotframework.org).
4

  
5
## How to Run It
6

  
7
### 1. Install pip
8

  
9
pip is a Python package management system which can be used to install Robot Framework. Get it at https://pip.pypa.io/en/stable/quickstart/.
10

  
11
### 2. Install Robot Framework using pip
12

  
13
`pip install robotframework`
14
`pip install robotframework-seleniumlibrary`
15

  
16
### 3. Install browser controlling driver
17

  
18
Tests written in Robot Framework have Selenium under cover. Selenium uses a headless browser to automatically interact with a webpage like a normal user would. For that, browser controller must be installed.
19

  
20
There are basically two options:
21
1. [geckodriver](https://github.com/mozilla/geckodriver/releases)
22
2. **[chromedriver](https://sites.google.com/a/chromium.org/chromedriver/downloads)** (default)
23

  
24
You should put path to the driver folder to your `Path`. Obviously, you should have Firefox or Chrome installed too for geckodriver/chromedriver to work.
25

  
26
### 4. Run Robot Framework
27

  
28
Assuming you have Python's Scripts folder added to your `Path`, you should be able to run all test suits:
29

  
30
`robot ./`
31

  
32
To set a custom output folder, use option `--outputdir`:
33

  
34
`robot --outputdir ./output ./`
35

  
36
To run a single test suit, point to that file:
37

  
38
`robot --outputdir ./output ./graph.robot`
39

  
40
To run a particular test from a test suite, use option `--test`:
41

  
42
`robot --outputdir ./output --test "General" ./graph.robot`
43

  
44
### 5. Check results
45

  
46
In your output folder (`./` by default), there should be a HTML file called `report.html`. It contains additional details about executed test runs.
sources/imiger-core/src/test/robot/common.robot
1
*** Settings ***
2
Documentation	A resource file with reusable keywords and variables.
3

  
4
Library			SeleniumLibrary
5
Library			OperatingSystem
6
Library			String
7

  
8

  
9
*** Variables ***
10
${BROWSER}		Chrome
11
${DELAY}		0.1
12

  
13
${SERVER}			http://localhost:8080/imiger/
14
${TEST DATA PATH}	${CURDIR}${/}data${/}
15

  
16
${UPLOAD FILES URL}	${SERVER}
17
${GRAPH URL}		${SERVER}/graph
18

  
19

  
20
*** Keywords ***
21
Open Browser To Base Path
22
	Open Browser		${UPLOAD FILES URL}		${BROWSER}
23
	Maximize Browser Window
24
	Set Selenium Speed	${DELAY}
25

  
26

  
27
Go To Upload Screen
28
	Go To				${UPLOAD FILES URL}
29

  
30

  
31
Open Diagram Raw
32
	Open Browser To Base Path
33
	${filePath}=		Normalize Path		${TEST DATA PATH}${/}raw${/}jira-project.json
34
	Choose File				name:file		${filePath}
35
	Click Button			Start visualization
36
	Wait Until Element Is Not Visible		//div[@id="loader"]
37

  
38

  
39
Open Diagram Spade
40
	Open Browser To Base Path
41
	${filePath}=		Normalize Path		${TEST DATA PATH}${/}spade${/}jira-project.json
42
	Choose File				name:file		${filePath}
43
	Select Radio Button		fileFormat		-968839389
44
	Click Button			Start visualization
45
	Wait Until Element Is Not Visible		//div[@id="loader"]
46

  
47

  
48
Reload Diagram Screen
49
	Reload Page
50
	Wait Until Element Is Not Visible		//div[@id="loader"]
51

  
52

  
53
Element Should Have Class
54
	[Arguments]		${element}		${className}
55
	${element}=		Catenate	SEPARATOR=	${element}	[contains(@class,"		${className}	")]
56
	Page Should Contain Element		${element}
57

  
58

  
59
Element Should Not Have Class
60
	[Arguments]		${element}		${className}
61
	${element}=		Catenate	SEPARATOR=	${element}	[contains(@class,"		${className}	")]
62
	Page Should Not Contain Element	${element}
63

  
64

  
65
Element Should Have Attribute
66
	[Arguments]		${element}		${attributeName}
67
	${element}=		Catenate	SEPARATOR=	${element}	[@	${attributeName}	]
68
	Page Should Contain Element		${element}
69

  
70

  
71
Element Should Not Have Attribute
72
	[Arguments]		${element}		${attributeName}
73
	Element Attribute Value Should Be	${element}	${attributeName}	${None}
74

  
75

  
76
Get Element Coordinates
77
	[Arguments]		${element}
78
	${transformAttributeValue}=		Get Element Attribute	${element}	transform
79
	${matches}=		Get Regexp Matches		${transformAttributeValue}	([0-9\.-]+)
80
	[Return]		${matches}
sources/imiger-core/src/test/robot/data/raw/jira-project.json
1
{
2
  "attributeTypes": [
3
    {
4
      "dataType": "STRING",
5
      "name": "EID",
6
      "text": "External ID"
7
    },
8
    {
9
      "dataType": "STRING",
10
      "name": "Name",
11
      "text": ""
12
    },
13
    {
14
      "dataType": "STRING",
15
      "name": "Description",
16
      "text": ""
17
    },
18
    {
19
      "dataType": "STRING",
20
      "name": "Comment",
21
      "text": ""
22
    },
23
    {
24
      "dataType": "STRING",
25
      "name": "Message",
26
      "text": "Commit message"
27
    },
28
    {
29
      "dataType": "STRING",
30
      "name": "Identities",
31
      "text": "Logins, aliases, other names"
32
    },
33
    {
34
      "dataType": "STRING",
35
      "name": "Emails",
36
      "text": ""
37
    },
38
    {
39
      "dataType": "ENUM",
40
      "name": "Roles",
41
      "text": ""
42
    },
43
    {
44
      "dataType": "ENUM",
45
      "name": "Author",
46
      "text": "Author's name"
47
    },
48
    {
49
      "dataType": "DATE",
50
      "name": "Created",
51
      "text": "Creation date"
52
    },
53
    {
54
      "dataType": "STRING",
55
      "name": "URL",
56
      "text": ""
57
    },
58
    {
59
      "dataType": "NUMBER",
60
      "name": "Number",
61
      "text": "Ticket number in issue tracker"
62
    },
63
    {
64
      "dataType": "ENUM",
65
      "name": "Assignee",
66
      "text": "Assignee's name"
67
    },
68
    {
69
      "dataType": "ENUM",
70
      "name": "Type",
71
      "text": ""
72
    },
73
    {
74
      "dataType": "ENUM",
75
      "name": "Priority",
76
      "text": ""
77
    },
78
    {
79
      "dataType": "ENUM",
80
      "name": "Severity",
81
      "text": ""
82
    },
83
    {
84
      "dataType": "DATE",
85
      "name": "Start",
86
      "text": "Start date"
87
    },
88
    {
89
      "dataType": "DATE",
90
      "name": "Due",
91
      "text": "Due date"
92
    },
93
    {
94
      "dataType": "ENUM",
95
      "name": "Iteration",
96
      "text": ""
97
    },
98
    {
99
      "dataType": "ENUM",
100
      "name": "Status",
101
      "text": ""
102
    },
103
    {
104
      "dataType": "ENUM",
105
      "name": "Resolution",
106
      "text": ""
107
    },
108
    {
109
      "dataType": "NUMBER",
110
      "name": "Estimate",
111
      "text": "Estimated time"
112
    },
113
    {
114
      "dataType": "NUMBER",
115
      "name": "Spent",
116
      "text": "Spent time"
117
    },
118
    {
119
      "dataType": "NUMBER",
120
      "name": "Progress",
121
      "text": "% done"
122
    },
123
    {
124
      "dataType": "ENUM",
125
      "name": "Categories",
126
      "text": ""
127
    },
128
    {
129
      "dataType": "STRING",
130
      "name": "Identifier",
131
      "text": ""
132
    },
133
    {
134
      "dataType": "DATE",
135
      "name": "Committed",
136
      "text": "Committed on date"
137
    },
138
    {
139
      "dataType": "STRING",
140
      "name": "Changes",
141
      "text": ""
142
    },
143
    {
144
      "dataType": "ENUM",
145
      "name": "Branches",
146
      "text": ""
147
    },
148
    {
149
      "dataType": "ENUM",
150
      "name": "Tags",
151
      "text": "VCS tags"
152
    },
153
    {
154
      "dataType": "ENUM",
155
      "name": "MIME",
156
      "text": "MIME type"
157
    },
158
    {
159
      "dataType": "NUMBER",
160
      "name": "Size",
161
      "text": "in bytes"
162
    },
163
    {
164
      "dataType": "ENUM",
165
      "name": "Relation",
166
      "text": "Relation type"
167
    },
168
    {
169
      "dataType": "ENUM",
170
      "name": "Role classes",
171
      "text": ""
172
    },
173
    {
174
      "dataType": "ENUM",
175
      "name": "Role super classes",
176
      "text": ""
177
    },
178
    {
179
      "dataType": "ENUM",
180
      "name": "Type class",
181
      "text": ""
182
    },
183
    {
184
      "dataType": "ENUM",
185
      "name": "Priority class",
186
      "text": ""
187
    },
188
    {
189
      "dataType": "ENUM",
190
      "name": "Priority super class",
191
      "text": ""
192
    },
193
    {
194
      "dataType": "ENUM",
195
      "name": "Severity class",
196
      "text": ""
197
    },
198
    {
199
      "dataType": "ENUM",
200
      "name": "Severity super class",
201
      "text": ""
202
    },
203
    {
204
      "dataType": "ENUM",
205
      "name": "Status class",
206
      "text": ""
207
    },
208
    {
209
      "dataType": "ENUM",
210
      "name": "Status super class",
211
      "text": ""
212
    },
213
    {
214
      "dataType": "ENUM",
215
      "name": "Resolution class",
216
      "text": ""
217
    },
218
    {
219
      "dataType": "ENUM",
220
      "name": "Resolution super class",
221
      "text": ""
222
    }
223
  ],
224
  "edgeArchetypes": [
225
    {
226
      "name": "Authorship",
227
      "text": ""
228
    },
229
    {
230
      "name": "Assignment",
231
      "text": ""
232
    },
233
    {
234
      "name": "CommitParticipation",
235
      "text": ""
236
    },
237
    {
238
      "name": "ItemRelation",
239
      "text": ""
240
    },
241
    {
242
      "name": "Affection",
243
      "text": ""
244
    },
245
    {
... Rozdílový soubor je zkrácen, protože jeho délka přesahuje max. limit.

Také k dispozici: Unified diff