Skip to content

Commit

Permalink
[TS_SELENIUM] Add VNC server to the "eclipse/che-e2e" docker image (#…
Browse files Browse the repository at this point in the history
…14730)


Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>
  • Loading branch information
Ohrimenko1988 authored Oct 2, 2019
1 parent 3eaa9f2 commit b1f0c16
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
6 changes: 5 additions & 1 deletion dockerfiles/e2e/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM selenium/standalone-chrome:latest

ENV DISPLAY=':20'

USER root

RUN apt-get update && apt-get install && \
apt-get install -y nodejs && \
apt-get install -y npm && \
npm install -g typescript && \
apt-get install vnc4server -y
apt-get install x11vnc -y

COPY e2e/package.json e2e/package-lock.json /tmp/e2e/

Expand All @@ -18,4 +20,6 @@ COPY entrypoint.sh /tmp/

WORKDIR /tmp/e2e

EXPOSE 5920

ENTRYPOINT [ "/tmp/entrypoint.sh" ]
12 changes: 12 additions & 0 deletions dockerfiles/e2e/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ if [ -z "$TEST_SUITE" ]; then
TEST_SUITE=test-happy-path
fi

# Launch display mode and VNC server
export DISPLAY=':20'
Xvfb :20 -screen 0 1920x1080x16 > /dev/null 2>&1 &
x11vnc -display :20 -N -forever > /dev/null 2>&1 &
echo ''
echo '#######################'
echo ''
echo 'For remote debug connect to the VNC server 0.0.0.0:5920'
echo ''
echo '#######################'
echo ''

# Launch selenium server
/usr/bin/supervisord --configuration /etc/supervisord.conf & \
export TS_SELENIUM_REMOTE_DRIVER_URL=http://localhost:4444/wd/hub
Expand Down
6 changes: 5 additions & 1 deletion e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@
- export the ```"TS_SELENIUM_BASE_URL"``` variable with "Che" url
- run command ```"npm run test-docker-mount-e2e"```

## Debug docker launch

The ```'eclipse/che-e2e'``` docker image has VNC server instaled inside. For connecting use ```'0.0.0.0:5920'``` adress.

## The "Happy Path" scenario launching

**The easiest way to do that is to perform steps which described in the "Docker launch" paragraph.
**The easiest way to do that is to perform steps which are described in the "Docker launch" paragraph.
For running tests without docker, please perform next steps:**

- Deploy Che on Kubernetes infrastructure by using 'Minikube' and 'Chectl' <https://github.com/eclipse/che/blob/master/deploy/kubernetes/README.md>
Expand Down
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "dist/index.js",
"scripts": {
"cleanup-docker": "if [ $(docker ps -a | grep -c selenium-e2e) -gt 0 ]; then docker rm -f $(docker ps --filter \"name=selenium-e2e\" -aq); fi;",
"test-docker": "npm run cleanup-docker && docker run -it --shm-size=2g --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL eclipse/che-e2e:nightly",
"test-docker-mount-e2e": "npm run cleanup-docker && docker run -it --shm-size=2g --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL -v $(pwd):/tmp/e2e:Z eclipse/che-e2e:nightly",
"test-docker": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL eclipse/che-e2e:nightly",
"test-docker-mount-e2e": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL -v $(pwd):/tmp/e2e:Z eclipse/che-e2e:nightly",
"test": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha.opts",
"test-happy-path": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-happy-path.opts",
"test-che-install": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-che-operatorhub.opts",
Expand Down

0 comments on commit b1f0c16

Please sign in to comment.