Skip to content

Commit be1b98d

Browse files
author
Hoisko Sakari.M 10802213
committed
Added dockerized env where to build / test / demo JavaFXLibrary with minimal setup
1 parent 06f8184 commit be1b98d

26 files changed

+186
-36
lines changed

AUTHORS.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Sami Pesonen 2017 -
44
Pasi Saikkonen 2017 -
55

66
Other contributors:
7-
Tatu Lahtela Find All With Pseudo Class and Find Class keywords
7+
Tatu Lahtela Find All With Pseudo Class and Find Class keywords
8+
Sakari Hoisko Dockerized linux env with X

Dockerfile_build

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM ubuntu:16.04 as builder
2+
ENV DEBIAN_FRONTEND noninteractive
3+
RUN apt-get -qq update && apt-get dist-upgrade -y && apt-get install -qq --no-install-recommends --allow-unauthenticated -y \
4+
openjdk-8-jdk \
5+
openjfx \
6+
python3-pip \
7+
maven \
8+
git-all \
9+
&& rm -rf /var/lib/apt/lists/* \
10+
&& mkdir code
11+
COPY . /code
12+
WORKDIR /code
13+
RUN mvn package -Dmaven.test.skip=true
14+
# ENTRYPOINT java -jar /code/target/javafxlibrary-*-SNAPSHOT-jar-with-dependencies.jar
15+
16+
FROM ubuntu:16.04
17+
RUN apt-get -qq update && apt-get dist-upgrade -y && apt-get install -qq --no-install-recommends --allow-unauthenticated -y \
18+
openjdk-8-jre \
19+
openjfx \
20+
&& rm -rf /var/lib/apt/lists/*
21+
COPY --from=builder /code/target/javafxlibrary-*-SNAPSHOT-jar-with-dependencies.jar .
22+
EXPOSE 8270
23+
ENTRYPOINT java -jar javafxlibrary-*-SNAPSHOT-jar-with-dependencies.jar

Dockerfile_release

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
THIS IS JUST DRAFT!!!
2+
3+
FROM ubuntu:16.04 as builder
4+
ENV DEBIAN_FRONTEND noninteractive
5+
RUN apt-get -qq update && apt-get dist-upgrade -y && apt-get install -qq --no-install-recommends --allow-unauthenticated -y \
6+
openjdk-8-jdk \
7+
openjfx \
8+
python3-pip \
9+
maven \
10+
git-all \
11+
&& mkdir code
12+
RUN wget latest https://github.com/eficode/JavaFXLibrary/releases Source code.zip && unzip
13+
WORKDIR /code
14+
RUN mvn package -Dmaven.test.skip=true
15+
16+
FROM ubuntu:16.04
17+
RUN apt-get -qq update && apt-get dist-upgrade -y && apt-get install -qq --no-install-recommends --allow-unauthenticated -y \
18+
openjdk-8-jre \
19+
openjfx \
20+
&& rm -rf /var/lib/apt/lists/*
21+
COPY --from=builder /code/target/JAVAFX:n testisoftat
22+
RUN wget https://github.com/eficode/JavaFXLibrary/releases JavaFXLibrary-0.4.1.jar
23+
EXPOSE 8270
24+
ENTRYPOINT java -jar JavaFXLibrary-0.4.1.jar jolle sisäään myös testisofta jarrit class pathinä/etc?

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,26 @@ java -cp "target/javafxlibrary-<version>.jar" org.robotframework.RobotFramework
7777

7878
```
7979
80+
## JavaFXLibrary Dockerized environment over remote library
81+
Requirements:
82+
* VNC viewer e.g. https://www.realvnc.com/en/connect/download/viewer/
83+
* Docker CE: https://docs.docker.com/install/
84+
* Docker-compose: https://docs.docker.com/compose/install/
85+
* VNC port: vnc://localhost:5900
86+
87+
Build & Start Dockerized Environment:
88+
```
89+
docker-compose up -d robot-framework javafxcompile
90+
```
91+
Take VNC connecion to: <i>vnc://<docker_daemon_ip>:5900</i>
92+
<br>Password is: 1234
93+
<br>Right click a mouse in VNC desktop and open shell.
94+
<br>Execute in shell:
95+
```
96+
robot -d /robot/results /robot/acceptance
97+
```
98+
FYI: remote server is running in different container than tests just GUIs are forwarded to VNC container
99+
80100
## Known issues
81101
82102
* If the remote library server and tests are running on the same machine, the server must be restarted between test executions. If the server is not restarted, test applications will launch behind other windows, causing tests to fail when robot is trying to interact with them.

docker-compose.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: '2'
2+
services:
3+
4+
robot-framework:
5+
build:
6+
context: ./docker/robot-javafx-demo
7+
ports:
8+
- '5900:5900'
9+
volumes:
10+
- './src/test/robotframework/:/robot'
11+
- screen-thing:/tmp/.X11-unix
12+
networks:
13+
- testapp
14+
15+
javafxcompile:
16+
build:
17+
context: ./
18+
dockerfile: Dockerfile_build
19+
restart: on-failure
20+
networks:
21+
- testapp
22+
volumes:
23+
- './src/:/src' # ScreenCapturingTest.robot require this.
24+
- screen-thing:/tmp/.X11-unix
25+
environment:
26+
- DISPLAY=:20.0
27+
28+
# javafxrelease:
29+
# build:
30+
# context: ./
31+
# dockerfile: Dockerfile_release
32+
# restart: on-failure
33+
# networks:
34+
# testapp:
35+
# aliases:
36+
# - javafxcompile
37+
# volumes:
38+
# - './src/:/src' # ScreenCapturingTest.robot require this.
39+
# - screen-thing:/tmp/.X11-unix
40+
# environment:
41+
# - DISPLAY=:20.0
42+
43+
networks:
44+
testapp:
45+
volumes:
46+
screen-thing:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM ubuntu:16.04
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
5+
RUN apt-get -qq update && apt-get dist-upgrade -y && apt-get install -qq --no-install-recommends --allow-unauthenticated -y \
6+
dbus \
7+
openssh-client \
8+
x11vnc \
9+
xvfb \
10+
bash \
11+
xterm \
12+
fluxbox \
13+
python-pip \
14+
git \
15+
nano \
16+
python-setuptools \
17+
wget \
18+
xvfb \
19+
xorg \
20+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
21+
22+
RUN pip install --no-cache-dir \
23+
robotframework
24+
25+
RUN mkdir ~/.vnc
26+
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
27+
COPY entrypoint.sh /entrypoint.sh
28+
EXPOSE 5900
29+
30+
ENTRYPOINT ["x11vnc", "-create", "-forever", "-env", "FD_PROG=/entrypoint.sh", "-env", "X11VNC_CREATE_GEOM=${1:-1024x768x16}", "-usepw"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
xhost +
3+
/usr/bin/fluxbox

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*** Settings ***
22
Documentation Tests to test javafxlibrary.keywords.ClickRobot related keywords
3-
Library JavaFXLibrary
3+
Resource ../resource.robot
44
Suite Setup Setup all tests
55
Suite Teardown Teardown all tests
66
Test Setup Reset Counters
@@ -307,7 +307,7 @@ Reset Counters
307307
Verify String id=buttonLabel Button has been clicked 0 times.
308308
Verify String id=rightClickButtonLabel Button has been right-clicked 0 times.
309309
Verify String id=doubleClickButtonLabel Button has been double-clicked 0 times.
310-
310+
311311
Verify String
312312
[Documentation] Verifies that string is equal in location
313313
[Arguments] ${query} ${string}

src/test/robotframework/acceptance/BoundsLocationTest.robot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*** Settings ***
22
Documentation Tests to test javafxlibrary.keywords.BoundsLocation related keywords
3-
Library JavaFXLibrary
3+
Resource ../resource.robot
44
Suite Setup Setup all tests
55
Suite Teardown Teardown all tests
66
Force Tags set-boundslocation
@@ -143,4 +143,4 @@ Get Bottom Decoration Height
143143
${SCENEY} Call Object Method ${SCENE} getY
144144
${SCENEHEIGHT} Call Object Method ${SCENE} getHeight
145145
${DECOHEIGHT} Evaluate ${WINDOWHEIGHT} - ${SCENEHEIGHT} - ${SCENEY}
146-
[Return] ${DECOHEIGHT}
146+
[Return] ${DECOHEIGHT}

src/test/robotframework/acceptance/DatePickerTest.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*** Settings ***
22
Documentation Tests to test DatePicker related keywords
3-
Library JavaFXLibrary
3+
Resource ../resource.robot
44
Suite Setup Setup all tests
55
Suite Teardown Teardown all tests
66
Test Teardown Clear Text Input css=.text-field

0 commit comments

Comments
 (0)