File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
main/java/javafxlibrary/keywords/AdditionalKeywords
test/robotframework/acceptance Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -1144,8 +1144,9 @@ public static Object getProgressBarValue(Object locator) {
11441144 + "``timeout`` is the maximum time in seconds that the events will be waited for. If the timeout is "
11451145 + "exceeded the keyword will fail. Default timeout is 5 seconds.\n \n " )
11461146 @ ArgumentNames ({ "timeout=" })
1147- public static void waitForEventsInFxApplicationThread (int timeout ) {
1147+ public static void waitForEventsInFxApplicationThread (int timeout ) throws Throwable {
11481148
1149+ final Throwable [] threadException = new JavaFXLibraryNonFatalException [1 ];
11491150 try {
11501151 Semaphore semaphore = new Semaphore (0 );
11511152 Platform .runLater (() -> semaphore .release ());
@@ -1165,16 +1166,21 @@ public static void waitForEventsInFxApplicationThread(int timeout) {
11651166 "Fx Application Thread: " + e .getMessage ());
11661167 }
11671168 });
1169+ t .setUncaughtExceptionHandler ((thread , e ) -> threadException [0 ] = e );
11681170 t .start ();
11691171 semaphore .acquire ();
1172+
1173+ if (threadException [0 ] != null )
1174+ throw threadException [0 ];
1175+
11701176 } catch (InterruptedException e ) {
11711177 throw new JavaFXLibraryNonFatalException ("Wait For Events in Fx Application Thread was interrupted: "
11721178 + e .getMessage ());
11731179 }
11741180 }
11751181
11761182 @ RobotKeywordOverload
1177- public static void waitForEventsInFxApplicationThread () {
1183+ public static void waitForEventsInFxApplicationThread () throws Throwable {
11781184 waitForEventsInFxApplicationThread (HelperFunctions .getWaitUntilTimeout ());
11791185 }
11801186}
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ Set Node Visibility (Call Method With Argument Types That Require Casting)
103103Wait For Events In Fx Application Thread
104104 [Tags] smoke demo-set
105105 Set Test Application javafxlibrary.testapps.TestBoundsLocation
106+ Set Timeout 3
106107 ${node } Find id=red
107108 Call Object Method In Fx Application Thread ${node } changeFillAfterTwoSeconds
108109 Wait For Events In Fx Application Thread
@@ -113,6 +114,7 @@ Wait For Events In Fx Application Thread
113114 Wait For Events In Fx Application Thread
114115 ${result } Find id=red
115116 Should End With ${result } fill=0xff0000ff]
117+ Set Timeout 0
116118
117119Find From Node
118120 [Tags] smoke
Original file line number Diff line number Diff line change @@ -43,14 +43,15 @@ Root Node Of XPath Query
4343 Should Be Equal ${ROOT_NODE } ${TARGET }
4444
4545Root Node Of Node That Does Not Exist
46- [Tags] smoke
46+ [Tags] smoke negative
4747 ${MSG } Run Keyword And Expect Error * Get Root Node Of id=non-existent-node-id
4848 Should Contain ${MSG } Unable to find any node with query: "id=non-existent-node-id"
4949
5050*** Keywords ***
5151Setup all tests
52- Launch Javafx Application ${TEST_APPLICATION }
53- Set Screenshot Directory ${OUTPUT_DIR }${/ } report-images
52+ Launch Javafx Application ${TEST_APPLICATION }
53+ Set Screenshot Directory ${OUTPUT_DIR }${/ } report-images
54+ Set Timeout 1
5455
5556Teardown all tests
56- Close Javafx Application
57+ Close Javafx Application
You can’t perform that action at this time.
0 commit comments