Skip to content

Commit 090c962

Browse files
authored
Merge pull request #20 from orf/add-browsers
Add support for browser tests
2 parents f642dd7 + 696e036 commit 090c962

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ env:
100100
- COMPOSE_APP=mariadb PYTHON_VERSION=3.7 MARIADB_VERSION=10.2
101101
- COMPOSE_APP=mariadb PYTHON_VERSION=3.7 MARIADB_VERSION=10.3
102102

103+
# Browsers:
104+
- COMPOSE_APP=chrome PYTHON_VERSION=3.5
105+
106+
matrix:
107+
allow_failures:
108+
- env: COMPOSE_APP=firefox PYTHON_VERSION=3.5
109+
103110
before_install:
104111
- echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee -a /etc/default/docker
105112
- sudo service docker restart
@@ -120,7 +127,7 @@ script:
120127
fi
121128
122129
after_failure:
123-
- docker-compose logs $COMPOSE_APP-db || true
130+
- docker-compose logs
124131

125132
deploy:
126133
provider: script

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN pip install --upgrade pip
3030

3131
COPY --chown=test:test tests/requirements/ /requirements/
3232
RUN for f in /requirements/*.txt; do pip install -r $f; done && \
33-
pip install flake8 flake8-isort sphinx pyenchant sphinxcontrib-spelling
33+
pip install flake8 flake8-isort sphinx pyenchant sphinxcontrib-spelling selenium
3434

3535
RUN mkdir /tests && chown -R test:test /tests
3636
USER test:test

docker-compose.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,33 @@ services:
158158
<<: *base
159159
entrypoint: flake8
160160

161+
# Browser tests
162+
chrome:
163+
<<: *base
164+
command: --selenium=chrome --selenium-hub=http://chrome-browser:4444/wd/hub
165+
environment:
166+
- WAIT_FOR=chrome-browser:4444
167+
depends_on:
168+
- chrome-browser
169+
chrome-browser:
170+
image: selenium/standalone-chrome
171+
volumes:
172+
- /dev/shm:/dev/shm
173+
174+
# Firefox tests fail on master
175+
firefox:
176+
<<: *base
177+
command: --selenium=firefox --selenium-hub=http://firefox-browser:4444/wd/hub
178+
environment:
179+
- WAIT_FOR=firefox-browser:4444
180+
depends_on:
181+
- firefox-browser
182+
firefox-browser:
183+
image: selenium/standalone-firefox
184+
volumes:
185+
- /dev/shm:/dev/shm
186+
187+
161188
volumes:
162189
oracle:
190+

0 commit comments

Comments
 (0)