Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be34114

Browse files
committed
Use new lookup queries in robot tests
1 parent 4c16c4a commit be34114

18 files changed

+685
-691
lines changed

src/main/java/javafxlibrary/keywords/AdditionalKeywords/ConvenienceKeywords.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public Object findClass(final String query) {
156156
}
157157

158158
@Deprecated
159-
@RobotKeyword("*DEPRECATED!!* Use keyword `Find` instead.\n\n"
159+
@RobotKeyword("*DEPRECATED!!* Use keyword `Find All` instead.\n\n"
160160
+ "Returns *all* descendant nodes of given node matching the query. \n\n"
161161
+ "``node`` is the starting point Object:Node from where to start looking, see `3.2 Using objects`. \n\n"
162162
+ "``query`` is a query locator, see `3.1 Using queries`.\n\n"
@@ -195,7 +195,7 @@ public List<Object> findAllFromNode(Object node, String query) {
195195
}
196196

197197
@Deprecated
198-
@RobotKeyword("*DEPRECATED!!* Use keyword `Find` instead.\n\n"
198+
@RobotKeyword("*DEPRECATED!!* Use keyword `Find All` instead.\n\n"
199199
+ "Returns *all* nodes matching query AND given pseudo-class state. \r\n"
200200
+ "``query`` is a query locator, see `3.1 Using queries`.\n\n"
201201
+ "``pseudo`` is a String value specifying pseudo class value.\n\n"

src/test/robotframework/acceptance/0_ClickRobotTest.robot

Lines changed: 92 additions & 93 deletions
Large diffs are not rendered by default.

src/test/robotframework/acceptance/BoundsLocationTest.robot

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Get Window Bounds
2828
2929
Get Scene Bounds
3030
[Tags] smoke
31-
${SCENE} Get Nodes Scene \#blue
31+
${SCENE} Get Scene id=blue
3232
${TARGET_X} Evaluate ${X_OFFSET} + ${L_DECORATION_WIDTH}
3333
${TARGET_Y} Evaluate ${Y_OFFSET} + ${T_DECORATION_HEIGHT}
3434
${TARGET_BOUNDS} Create Bounds ${TARGET_X} ${TARGET_Y} 600 600
@@ -37,7 +37,7 @@ Get Scene Bounds
3737
3838
Get Node Bounds (BLUE)
3939
[Tags] smoke
40-
${BLUE} Find \#blue
40+
${BLUE} Find id=blue
4141
${NODE_BOUNDS} Get Bounds ${BLUE}
4242
${TARGET_Y} Evaluate ${Y_OFFSET} + ${T_DECORATION_HEIGHT} + ${300}
4343
${TARGET_X} Evaluate ${X_OFFSET} + ${L_DECORATION_WIDTH}
@@ -46,7 +46,7 @@ Get Node Bounds (BLUE)
4646
4747
Get Node Bounds (PINK)
4848
[Tags] smoke
49-
${PINK} Find \#pink
49+
${PINK} Find id=pink
5050
${NODE_BOUNDS} Get Bounds ${PINK}
5151
${TARGET_X} Evaluate ${X_OFFSET} + ${L_DECORATION_WIDTH} + ${450}
5252
${TARGET_Y} Evaluate ${Y_OFFSET} + ${T_DECORATION_HEIGHT} + ${75}
@@ -62,7 +62,7 @@ Get Point Bounds
6262
6363
Get Query Bounds
6464
[Tags] smoke
65-
${BOUNDS} Get Bounds \#blue
65+
${BOUNDS} Get Bounds id=blue
6666
${TARGET_Y} Evaluate ${Y_OFFSET} + ${T_DECORATION_HEIGHT} + ${300}
6767
${TARGET_X} Evaluate ${X_OFFSET} + ${L_DECORATION_WIDTH}
6868
${TARGET} Create Bounds ${TARGET_X} ${TARGET_Y} 600 300
@@ -79,8 +79,8 @@ Get Bounds Using XPath Query
7979
Get Bounds Of Id That Does Not Exist
8080
[Tags] smoke negative
8181
Set Timeout ${1}
82-
${MSG} Run Keyword And Expect Error * Get Bounds \#idThatDoesNotExist
83-
Should Be Equal ${MSG} Given element "\#idThatDoesNotExist" was not found within given timeout of 1 SECONDS
82+
${MSG} Run Keyword And Expect Error * Get Bounds id=idThatDoesNotExist
83+
Should Be Equal ${MSG} Given element "id=idThatDoesNotExist" was not found within given timeout of 1 SECONDS
8484
Set Timeout ${5}
8585
8686
*** Keywords ***
@@ -114,14 +114,14 @@ Set Decoration Values
114114
Get Left Decoration Width
115115
[Arguments] ${WINDOW}
116116
${ROOT} Get Root Node Of ${WINDOW}
117-
${SCENE} Get Nodes Scene ${ROOT}
117+
${SCENE} Get Scene ${ROOT}
118118
${WIDTH} Call Object Method ${SCENE} getX
119119
[Return] ${WIDTH}
120120
121121
Get Right Decoration Width
122122
[Arguments] ${WINDOW}
123123
${ROOT} Get Root Node Of ${WINDOW}
124-
${SCENE} Get Nodes Scene ${ROOT}
124+
${SCENE} Get Scene ${ROOT}
125125
${WINDOWWIDTH} Call Object Method ${WINDOW} getWidth
126126
${SCENEX} Call Object Method ${SCENE} getX
127127
${SCENEWIDTH} Call Object Method ${SCENE} getWidth
@@ -131,14 +131,14 @@ Get Right Decoration Width
131131
Get Top Decoration Height
132132
[Arguments] ${WINDOW}
133133
${ROOT} Get Root Node Of ${WINDOW}
134-
${SCENE} Get Nodes Scene ${ROOT}
134+
${SCENE} Get Scene ${ROOT}
135135
${HEIGHT} Call Object Method ${SCENE} getY
136136
[Return] ${HEIGHT}
137137
138138
Get Bottom Decoration Height
139139
[Arguments] ${WINDOW}
140140
${ROOT} Get Root Node Of ${WINDOW}
141-
${SCENE} Get Nodes Scene ${ROOT}
141+
${SCENE} Get Scene ${ROOT}
142142
${WINDOWHEIGHT} Call Object Method ${WINDOW} getHeight
143143
${SCENEY} Call Object Method ${SCENE} getY
144144
${SCENEHEIGHT} Call Object Method ${SCENE} getHeight

src/test/robotframework/acceptance/DatePickerTest.robot

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Documentation Tests to test DatePicker related keywords
33
Library JavaFXLibrary
44
Suite Setup Setup all tests
55
Suite Teardown Teardown all tests
6-
Test Teardown Clear Text Input .text-field
6+
Test Teardown Clear Text Input css=.text-field
77
Force Tags set-datepicker
88

99
*** Variables ***
@@ -12,23 +12,23 @@ ${TEST_APPLICATION} javafxlibrary.testapps.DatePickerApp
1212
*** Test Cases ***
1313
Select JavaFXLibrary Release Date
1414
[Tags] smoke demo-set
15-
Write To .text-field JavaFXLibrary Open Source Release
16-
Click On .arrow-button
15+
Write To css=.text-field JavaFXLibrary Open Source Release
16+
Click On css=.arrow-button
1717
Set Month March
1818
Set Year 2018
19-
Click On 23
20-
${date} Get Selected Date Picker Date .date-picker
21-
Should End With ${date} 2018-03-23
19+
Click On text="23"
20+
${date} Get Selected Date Picker Date css=.date-picker
21+
Should End With ${date} 2018-03-23
2222

2323
Select JavaFX Release Date
2424
[Tags] smoke demo-set
25-
Write To .text-field JavaFX Release
26-
Click On .arrow-button
25+
Write To css=.text-field JavaFX Release
26+
Click On css=.arrow-button
2727
Set Month December
2828
Set Year 2008
29-
Click On 4
30-
${date} Get Selected Date Picker Date .date-picker
31-
Should End With ${date} 2008-12-04
29+
Click On text="4"
30+
${date} Get Selected Date Picker Date css=.date-picker
31+
Should End With ${date} 2008-12-04
3232

3333
*** Keywords ***
3434
Setup all tests
@@ -40,9 +40,9 @@ Teardown all tests
4040

4141
Set Year
4242
[Arguments] ${year}
43-
${time_labels} Find All .spinner-label
43+
${time_labels} Find All css=.spinner-label
4444
${year_label} Set Variable @{time_labels}[1]
45-
${left_arrows} Find All .left-button
45+
${left_arrows} Find All css=.left-button
4646
${prev_year} Set Variable @{left_arrows}[1]
4747
:FOR ${i} IN RANGE 99
4848
\ ${current} Get Node Text ${year_label}
@@ -51,8 +51,8 @@ Set Year
5151

5252
Set Month
5353
[Arguments] ${month}
54-
${month_label} Find .spinner-label
55-
${prev_month} Find .left-button
54+
${month_label} Find css=.spinner-label
55+
${prev_month} Find css=.left-button
5656
:FOR ${i} IN RANGE 99
5757
\ ${current} Get Node Text ${month_label}
5858
\ Exit For Loop If '${current}' == '${month}'

0 commit comments

Comments
 (0)