diff --git a/.gitattributes b/.gitattributes index 35efda5..08b6e8e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ -# https://git-scm.com/docs/gitattributes -# unix line feeds to every file (if dos linefeeds needed can be overridden) +# https://git-scm.com/docs/gitattributes +# unix line feeds to every file (if dos linefeeds needed can be overridden) * -text \ No newline at end of file diff --git a/.gitignore b/.gitignore index f960d0f..889580c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,11 @@ JavaFXLib-*.png .idea *.iml report-images +*.DS_Store # temporary pom file by shade plugin dependency-reduced-pom.xml + +# TODO: put logs to some other location, e.g. under target that gets cleaned +# docker demo environment robot reports +src/test/robotframework/results/ \ No newline at end of file diff --git a/AUTHORS.txt b/AUTHORS.txt index 4b5c288..9a5e4bc 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,10 +1,11 @@ Core contributors: -Jukka Haavisto 2017 - -Sami Pesonen 2017 - -Pasi Saikkonen 2017 - +Jukka Haavisto 2017 - +Sami Pesonen 2017 - +Pasi Saikkonen 2017 - Other contributors: -Tatu Lahtela Find All With Pseudo Class and Find Class keywords -Sakari Hoisko Dockerized linux env with X -Juho Lehtonen Optimized docker environment. -Juho Saarinen Package improvements +Tatu Lahtela Find All With Pseudo Class and Find Class keywords +Sakari Hoisko Dockerized linux env with X +Juho Lehtonen Optimized docker environment. +Juho Saarinen Package improvements, initial monocle support, screenshot bug fix +Turo Soisenniemi Initial java agent support diff --git a/BUILD.md b/BUILD.md index 903c64e..34497f5 100644 --- a/BUILD.md +++ b/BUILD.md @@ -16,8 +16,8 @@ JavaFXLibrary uses Apache Maven as a build tool. are being used by both JavaFXLibrary and the AUT. It's not uncommon that a specific version is needed for AUT and another version of the same dependency is required for JavaFXLibrary(e.g. TestFX dependency for Google Guava). Not always are these dependencies backwards compatible and therefore JavaFXLibrary has adopted Apache Maven Shade Plugin to cope with this issue. - Currently the package com.google.common has been renamed in JavaFXLibrary as shaded.com.google.common to avoid version - mismatches with Google Guava dependencies. See https://maven.apache.org/plugins/maven-shade-plugin/ for more info. + Currently the package com.google.common has been renamed in JavaFXLibrary as shaded.com.google.common and org.apache.commons as shaded.org.apache.commons to avoid version + mismatches with dependencies in AUT and internally. See https://maven.apache.org/plugins/maven-shade-plugin/ for more info. ## Releasing @@ -25,6 +25,7 @@ JavaFXLibrary uses Apache Maven as a build tool. * update library version to x.x.x in pom.xml * run tests ``mvn clean verify`` * copy target/robotframework/libdoc/javafxlibrary.html under docs directory (check that README.md links to correct file) +* update links in README.md to point correct version in maven central * ``git commit -m "version to x.x.x" pom.xml docs/javafxlibrary.html`` * create tag ``git tag -a x.x.x`` * push ``git push origin master`` and ``git push origin x.x.x`` @@ -58,8 +59,12 @@ JavaFXLibrary uses Apache Maven as a build tool. ```` * Release snapshot or actual release (depending what is in version tag in pom.xml)``mvn clean deploy -P release`` + * In case of release log in to https://oss.sonatype.org: + * from left choose `Staging repositories` and scroll down, choose `robotframework-*` repository and review + * choose from top toolbar `Release`, add to reason field `x.y.z release` and submit + * sync takes typically hours before visible in Maven Central * snapshots can be found from https://oss.sonatype.org/content/repositories/snapshots/org/robotframework/javafxlibrary/ - * actual releases can be found from https://search.maven.org/ and typing `javafxlibrary` in the search field. + * actual releases can be found from https://search.maven.org/ and typing `javafxlibrary` in the search field. ## Announcements diff --git a/Dockerfile_build b/Dockerfile_build index d34c660..834ae4e 100644 --- a/Dockerfile_build +++ b/Dockerfile_build @@ -14,8 +14,9 @@ RUN mvn package # ENTRYPOINT java -jar /code/target/javafxlibrary-*-SNAPSHOT-jar-with-dependencies.jar FROM ubuntu:16.04 -COPY --from=builder /code/target/javafxlibrary-*-SNAPSHOT-jar-with-dependencies.jar /. -COPY --from=builder /code/target/javafxlibrary-*-SNAPSHOT-tests.jar /. +COPY --from=builder /code/target/javafxlibrary-*-jar-with-dependencies.jar / +COPY --from=builder /code/target/javafxlibrary-*-tests.jar / +RUN echo "Built following jar files" && ls -latr /*.jar COPY entrypoint_build.sh /. RUN apt-get -qq update && apt-get dist-upgrade -y && apt-get install -qq --no-install-recommends --allow-unauthenticated -y \ openjdk-8-jre \ diff --git a/README.md b/README.md index 9d5acd1..6d74771 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,12 @@ JavaFXLibrary works with both Jython (local and remote use) and Python (remote only) versions of Robot Framework. This means JavaFXLibrary can be used with Jython incompatible test libraries too by importing it as a remote library. -JavaFXLibrary is tested to work with Robot Framework 3.0.2 or later. +JavaFXLibrary is tested to work with Java 8 and Robot Framework 3.2.1 or later. ## Keyword documentation -See keyword [documentation](https://eficode.github.io/JavaFXLibrary/javafxlibrary.html). +See keyword [documentation](https://repo1.maven.org/maven2/org/robotframework/javafxlibrary/0.7.1/javafxlibrary-0.7.1.html). + +For editors (IDEs) keyword documentation can be obtained from [here](https://repo1.maven.org/maven2/org/robotframework/javafxlibrary/0.7.1/javafxlibrary-0.7.1.xml). ## Taking the library into use ### As a local library @@ -17,7 +19,7 @@ See keyword [documentation](https://eficode.github.io/JavaFXLibrary/javafxlibrar *** Settings *** Library JavaFXLibrary ``` -3. Add library jar to Jython [module search path](http://robotframework.org/robotframework/3.0b1/RobotFrameworkUserGuide.html#configuring-where-to-search-libraries-and-other-extensions) and run your tests: +3. Add library jar to Jython [module search path](http://robotframework.org/robotframework/3.1.2/RobotFrameworkUserGuide.html#configuring-where-to-search-libraries-and-other-extensions) and run your tests: ``` jython -J-cp javafxlibrary-.jar -m robot.run tests.robot ``` @@ -44,7 +46,7 @@ To use JavaFXLibrary on macOS Mojave you must enable the accessibility features - Enable accessibility features by checking the box: :white_check_mark: Terminal ## Identifying JavaFX UI objects -[Scenic View](http://fxexperience.com/scenic-view/) is a tool that allows you to inspect the JavaFX application scenegraph. This can be useful especially when you do not have access to the source code. +[Scenic View](https://github.com/JonathanGiles/scenic-view) is a tool that allows you to inspect the JavaFX application scenegraph. This can be useful especially when you do not have access to the source code. See [keyword documentation](https://eficode.github.io/JavaFXLibrary/javafxlibrary.html#3.%20Locating%20JavaFX%20Nodes) for detailed information about handling UI elements with the library. @@ -70,4 +72,32 @@ Library's acceptance test suite can be used as a JavaFXLibrary demo. Running the Executing _test.sh_ runs the acceptance suite twice: first using JavaFXLibrary as a local Robot Framework library on Jython, and after that using the library in remote mode executing the same tests on python version of Robot Framework. -If you want the suite to run only once, you can define which type of library to use by including **local** or **remote** as an argument. For example command `test.sh remote` will execute the suite only in remote mode. \ No newline at end of file +If you want the suite to run only once, you can define which type of library to use by including **local** or **remote** as an argument. For example command `test.sh remote` will execute the suite only in remote mode. + +## Experimental: Headless support +Library supports headless operation utilizing [Monocle](https://wiki.openjdk.java.net/display/OpenJFX/Monocle). The support for this is still at experimental level. + +### Main issues with headless function +* Scrolling doesn't work same way as with screen + * "Tick" (amount of scrolling) is much smaller in headless than normally + * Vertical (left/right) scrolling is not working +* Separate app windows' can't be closed (unless app offers that functionality itself) +* Swing applications can't be tested in headless mode. + +### Enabling headless mode +Headless mode can be enabled by setting first library initialization to "True". + +Locally: +``` +*** Settings *** +Library JavaFXLibrary ${True} +``` + +Remote: +``` +*** Settings *** +Library Remote http://127.0.0.1:8270 ${True} WITH NAME JavaFXLibrary +``` + +## Experimental: Java agent support +Library can be used as java agent. Launch application with `-javaagent:/path/to/javafxlibrary-.jar`. Default port is 8270 and can be changed with adding `=` to java agent command. Only remote library is supported. Using launch keyword is still required but instead of starting new application keyword initializes Stage for library. diff --git a/docker-compose.yml b/docker-compose.yml index 6c63797..016492d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: - testapp environment: - RESOLUTION=1920x1080 + - X11VNC_ARGS=-multiptr javafxcompile: build: diff --git a/docker/robot-javafx-demo/Dockerfile b/docker/robot-javafx-demo/Dockerfile index fe1dbac..0e75a4a 100644 --- a/docker/robot-javafx-demo/Dockerfile +++ b/docker/robot-javafx-demo/Dockerfile @@ -1,4 +1,4 @@ -FROM dorowu/ubuntu-desktop-lxde-vnc +FROM dorowu/ubuntu-desktop-lxde-vnc:bionic ENV DEBIAN_FRONTEND noninteractive @@ -10,7 +10,12 @@ RUN apt-get -qq update && apt-get dist-upgrade -y && apt-get install -qq --no-i python-setuptools \ wget \ openjdk-8-jre \ - openjfx \ + # Install older version of openjfx, current version is incompatible with openjdk8 + # Bug ticket: https://bugs.launchpad.net/ubuntu/+source/openjfx/+bug/1799946 + openjfx=8u161-b12-1ubuntu2 \ + libopenjfx-java=8u161-b12-1ubuntu2 \ + libopenjfx-jni=8u161-b12-1ubuntu2 \ + openjfx-source=8u161-b12-1ubuntu2 \ && apt-get clean && rm -rf /var/lib/apt/lists/* COPY test.sh /bin/test.sh diff --git a/docs/javafxlibrary.html b/docs/javafxlibrary.html index 7d15eb3..b2179aa 100644 --- a/docs/javafxlibrary.html +++ b/docs/javafxlibrary.html @@ -5,8 +5,8 @@ - - + +