You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ docker run -d -p 4444:4444 --name selenium-hub selenium/hub:2.44.0
23
22
```
24
23
25
24
### Chrome and Firefox Nodes
26
25
26
+
df/f-r/n
27
+
27
28
```bash
28
-
$ docker run -d --link selenium-hub:hub elgalu/selenium-node-chrome:2.44.0
29
-
$ docker run -d --link selenium-hub:hub elgalu/selenium-node-firefox:2.44.0
29
+
$ docker run -d --link selenium-hub:hub selenium/node-chrome:2.44.0
30
+
$ docker run -d --link selenium-hub:hub selenium/node-firefox:2.44.0
30
31
```
31
32
32
33
### Self contained Selenium container
33
34
34
35
```bash
35
-
$ docker run -d -p 4444:4444 -p 5900:5900 elgalu/selenium-full:2.44.0
36
+
$ docker run -d -p 4444:4444 selenium/full:2.44.0
36
37
```
37
38
38
39
## Building the images
39
40
40
-
Ensure you have the `phusion/baseimage:0.9.15` base image downloaded, this step is _optional_ since docker takes care of downloading the parent base image automatically.
41
+
Ensure you have the `ubuntu:14.04` base image downloaded, this step is _optional_ since docker takes care of downloading the parent base image automatically.
41
42
42
43
```bash
43
-
$ docker pull phusion/baseimage:0.9.15
44
+
$ docker pull ubuntu:14.04
44
45
```
45
46
46
47
Clone the repo and from the project directory root you can build everything by running:
@@ -56,77 +57,25 @@ _Note: omitting `VERSION=local` will build the images with the current version n
56
57
##### e.g. Spawn a container for Chrome testing:
57
58
58
59
```bash
59
-
$ docker run -d --name selenium-hub -p=127.0.0.1::4444 elgalu/selenium-hub:2.44.0
60
-
$ CH=$(docker run --rm --name=ch -p=127.0.0.1::5900 \
60
+
$ docker run -d --name selenium-hub -p 4444:4444 selenium/hub:2.44.0
Note `-v /e2e/uploads:/e2e/uploads` is optional in case you are testing browser uploads on your webapp you'll probably need to share a directory for this.
73
67
74
-
The `127.0.0.1::` part is to avoid binding to all network interfaces, most of the time you don't need to expose the docker container like that so just *localhost* for now.
75
-
76
68
I like to remove the containers after each e2e test with `--rm` since this docker container is not meant to preserve state, spawning a new one is less than 3 seconds. You need to think of your docker container as processes, not as running virtual machines if case you are familiar with vagrant.
77
69
78
-
A dynamic port will be binded to the container ones, i.e.
79
-
80
-
```bash
81
-
# Obtain the selenium port you'll connect to:
82
-
docker port selenium-hub 4444
83
-
# -- or --
84
-
docker port $CH 4444
85
-
#=> 127.0.0.1:49155
86
-
87
-
# Obtain the VNC server port in case you want to look around
88
-
docker port $CH 5900
89
-
#=> 127.0.0.1:49160
90
-
```
91
-
92
70
##### e.g. Spawn a container for Firefox testing:
93
71
94
72
This command line is the same as for Chrome, remember that the selenium running container is able to launch either Chrome or Firefox, the idea around having 2 separate containers, one for each browser is for convenience plus avoid certain `:focus` issues you web app may encounter during e2e automation.
95
73
96
74
```bash
97
-
$ docker run -d --name selenium-hub -p=127.0.0.1::4444 elgalu/selenium-hub:2.44.0
98
-
$ FF=$(docker run --rm --name=ch -p=127.0.0.1::5900 \
75
+
$ docker run -d --name selenium-hub -p 4444:4444 selenium/hub:2.44.0
In case you have RealVNC binary `vnc` in your path, you can always take a look, view only to avoid messing around your tests with an unintended mouse click or keyboard.
113
-
114
-
```bash
115
-
$ ./bin/vncview 127.0.0.1:49160
116
-
```
117
-
118
-
If you are running Boot2Docker on Mac then you already have a [VNC client](http://www.davidtheexpert.com/post.php?id=5) built-in. You can connect by entering `vnc://<boot2docker-ip>:49160` in Safari or [Alfred](http://www.alfredapp.com/)
119
-
120
-
When you are prompted for the password it is __secret__. If you wish to change this then you should either change it in the `/NodeBase/Dockerfile` and build the images yourself, or you can define a docker image that derives from the posted ones which reconfigures it:
121
-
122
-
```dockerfile
123
-
FROM elgalu/selenium-node-base:2.44.0
124
-
#FROM elgalu/selenium-node-chrome:2.44.0
125
-
#FROM elgalu/selenium-node-firefox:2.44.0
126
-
#FROM elgalu/selenium-full:2.44.0
127
-
# Choose the FROM statement that works for you.
128
-
129
-
RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
78
+
selenium/node-firefox:2.44.0)
130
79
```
131
80
132
81
##### Look around
@@ -135,13 +84,12 @@ RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
135
84
$ docker images
136
85
#=>
137
86
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
138
-
elgalu/selenium-full 2.44.0 68e369e3141e 30 minutes ago 886.3 MB
139
-
elgalu/selenium-node-firefox 2.44.0 c7c0c99afabd 31 minutes ago 695.9 MB
140
-
elgalu/selenium-node-chrome 2.44.0 c4cd17423321 31 minutes ago 796.7 MB
141
-
elgalu/selenium-node-base 2.44.0 4f7c1788fe4c 32 minutes ago 584.8 MB
142
-
elgalu/selenium-hub 2.44.0 427462f54676 35 minutes ago 431.4 MB
143
-
elgalu/selenium-base 2.44.0 9126579ae96e 35 minutes ago 431.4 MB
144
-
phusion/baseimage 0.9.15 cf39b476aeec 4 weeks ago 289.4 MB
87
+
selenium/node-firefox 2.44.0 c7c0c99afabd 31 minutes ago 695.9 MB
88
+
selenium/node-chrome 2.44.0 c4cd17423321 31 minutes ago 796.7 MB
89
+
selenium/node-base 2.44.0 4f7c1788fe4c 32 minutes ago 584.8 MB
90
+
selenium/hub 2.44.0 427462f54676 35 minutes ago 431.4 MB
91
+
selenium/base 2.44.0 9126579ae96e 35 minutes ago 431.4 MB
92
+
ubuntu 14.04 5506de2b643b 3 weeks ago 199.3 MB
145
93
```
146
94
147
95
### Troubleshooting
@@ -151,13 +99,3 @@ All output is sent to stdout so it can be inspected by running:
151
99
```bash
152
100
$ docker logs -f <container-id|container-name>
153
101
```
154
-
155
-
The containers leave a few log files in addition to stdout output to see what happened:
0 commit comments