Skip to content

Commit 40fab98

Browse files
committed
Add negative tests for Find and Find All
1 parent 549635c commit 40fab98

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

src/test/robotframework/acceptance/FindTest.robot

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*** Settings ***
2-
Documentation Tests to test javafxlibrary keywords
2+
Documentation Tests to test javafxlibrary.keywords.AdditionalKeywords.Find related keywords
33
Library JavaFXLibrary
44
Suite Setup Setup all tests
55
Suite Teardown Teardown all tests
@@ -121,7 +121,46 @@ Find All With Pseudo Class
121121
Should Contain ${hovered} ${node}
122122

123123
# TODO: Add test for text= prefix when next TestFX version comes out (4.0.14-alpha)
124-
# TODO: Add negative tests
124+
125+
Nothing Is Found
126+
[Tags] smoke negative
127+
${node} Find css=NoSuchSelector
128+
Should Be Empty ${node}
129+
130+
Nothing Is Found When failIfNotFound Is True
131+
[Tags] smoke negative
132+
${msg} Run Keyword And Expect Error * Find css=NoSuchSelector true
133+
Should Be Equal ${msg} Unable to find anything with query: "css=NoSuchSelector"
134+
135+
Nothing Is Found With Find All
136+
[Tags] smoke negative
137+
${nodes} Find All css=NoSuchSelector
138+
Should Be Empty ${nodes}
139+
140+
Nothing Is Found With Find All When failIfNotFound Is True
141+
[Tags] smoke negative
142+
${msg} Run Keyword And Expect Error * Find All css=NoSuchSelector true
143+
Should Be Equal ${msg} Unable to find anything with query: "css=NoSuchSelector"
144+
145+
Previous Query Returns Nothing In Chained Selector
146+
[Tags] smoke negative
147+
${node} Find css=VBox css=ZBox Pane id=lime
148+
Should Be Empty ${node}
149+
150+
Previous Query Returns Nothing In Chained Selector With Find All
151+
[Tags] smoke negative
152+
${nodes} Find All css=VBox css=ZBox Pane id=lime
153+
Should Be Empty ${nodes}
154+
155+
Previous Query Returns Nothing In Chained Selector When failIfNotFound Is True
156+
[Tags] smoke negative
157+
${msg} Run Keyword And Expect Error * Find css=VBox css=ZBox Pane id=lime true
158+
Should Be Equal ${msg} Unable to find anything with query: "css=VBox css=ZBox Pane id=lime"
159+
160+
Previous Query Returns Nothing In Chained Selector With Find All When failIfNotFound Is True
161+
[Tags] smoke negative
162+
${msg} Run Keyword And Expect Error * Find All css=VBox css=ZBox Pane id=lime true
163+
Should Be Equal ${msg} Unable to find anything with query: "css=VBox css=ZBox Pane id=lime"
125164

126165
*** Keywords ***
127166
Setup all tests

0 commit comments

Comments
 (0)