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

Skip to content

Commit e039595

Browse files
committed
Merge branches 'DockerizedEnv' and 'master' of https://github.com/eficode/JavaFXLibrary into DockerizedEnv
# Conflicts: # src/main/java/JavaFXLibrary.java # src/test/robotframework/acceptance/NodeLookupTest.robot
2 parents 36c2e3f + 2439972 commit e039595

File tree

8 files changed

+24
-15
lines changed

8 files changed

+24
-15
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can connect to applications running on your local machine or even on a diffe
1010

1111

1212
## Keyword documentation
13-
See keyword [documentation](https://eficode.github.io/JavaFXLibrary/JavaFXLibrary.html).
13+
See keyword [documentation](https://eficode.github.io/JavaFXLibrary/javafxlibrary.html).
1414

1515
## Installation
1616

docs/JavaFXLibrary.html renamed to docs/javafxlibrary.html

+1-1
Large diffs are not rendered by default.

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<groupId>org.robotframework</groupId>
2222
<artifactId>javafxlibrary</artifactId>
2323
<packaging>jar</packaging>
24-
<version>0.4.2-SNAPSHOT</version>
24+
<version>0.5.0</version>
2525
<properties>
2626
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2727
</properties>

src/main/java/JavaFXLibrary.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public Object runKeyword(String keywordName, Object[] args) {
8181
AtomicReference<RuntimeException> retExcep = new AtomicReference<>();
8282

8383
try {
84-
// timeout + 100 ms so that underlying timeout has a chance to expire first
84+
// timeout + 500 ms so that underlying timeout has a chance to expire first
8585
WaitForAsyncUtils.waitFor(getWaitUntilTimeout(TimeUnit.MILLISECONDS) + 500, TimeUnit.MILLISECONDS, () -> {
8686

8787
try {

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

+8-2
Original file line numberDiff line numberDiff 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
}

src/main/java/javafxlibrary/utils/finder/Finder.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public Node find(String query) {
4040
// TODO: Remove old style lookup queries
4141
// Use TestFX lookup for queries with no prefixes
4242
if (!QueryParser.startsWithPrefix(query)) {
43-
RobotLog.warn("You are using deprecated lookup queries! See library documentation for information about " +
44-
"the updated lookup query syntax.");
43+
//RobotLog.warn("You are using deprecated lookup queries! See library documentation for information about " +
44+
// "the updated lookup query syntax.");
4545
return robot.lookup(query).query();
4646
}
4747

@@ -63,8 +63,8 @@ public Node find(String query, Parent root) {
6363
// TODO: Remove old style lookup queries
6464
// Use TestFX lookup for queries with no prefixes
6565
if (!QueryParser.startsWithPrefix(query)) {
66-
RobotLog.warn("You are using deprecated lookup queries! See library documentation for information about " +
67-
"the updated lookup query syntax.");
66+
//RobotLog.warn("You are using deprecated lookup queries! See library documentation for information about " +
67+
// "the updated lookup query syntax.");
6868
return robot.from(root).lookup(query).query();
6969
}
7070

@@ -97,8 +97,8 @@ public Set<Node> findAll(String query) {
9797
// TODO: Remove old style lookup queries
9898
// Use TestFX lookup for queries with no prefixes
9999
if (!QueryParser.startsWithPrefix(query)) {
100-
RobotLog.warn("You are using deprecated lookup queries! See library documentation for information about " +
101-
"the updated lookup query syntax.");
100+
//RobotLog.warn("You are using deprecated lookup queries! See library documentation for information about " +
101+
// "the updated lookup query syntax.");
102102
return robot.lookup(query).queryAll();
103103
}
104104

@@ -116,8 +116,8 @@ public Set<Node> findAll(String query, Parent root) {
116116
// TODO: Remove old style lookup queries
117117
// Use TestFX lookup for queries with no prefixes
118118
if (!QueryParser.startsWithPrefix(query)) {
119-
RobotLog.warn("You are using deprecated lookup queries! See library documentation for information about " +
120-
"the updated lookup query syntax.");
119+
//RobotLog.warn("You are using deprecated lookup queries! See library documentation for information about " +
120+
// "the updated lookup query syntax.");
121121
return robot.from(root).lookup(query).query();
122122
}
123123

src/test/robotframework/acceptance/MiscTests.robot

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Set Node Visibility (Call Method With Argument Types That Require Casting)
103103
Wait 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

117119
Find From Node
118120
[Tags] smoke

src/test/robotframework/acceptance/NodeLookupTest.robot

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Root Node Of XPath Query
4343
Should Be Equal ${ROOT_NODE} ${TARGET}
4444
4545
Root 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
@@ -52,6 +52,7 @@ Setup all tests
5252
Import JavaFXLibrary
5353
Launch Javafx Application ${TEST_APPLICATION}
5454
Set Screenshot Directory ${OUTPUT_DIR}${/}report-images
55+
Set Timeout 1
5556
5657
Teardown all tests
5758
Close Javafx Application

0 commit comments

Comments
 (0)