Skip to content

Commit 4c2ea6a

Browse files
committed
Add selenium tests. Closes #7.
1 parent f642dd7 commit 4c2ea6a

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ 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+
103106
before_install:
104107
- echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee -a /etc/default/docker
105108
- sudo service docker restart
@@ -108,7 +111,7 @@ install:
108111
- pip install docker-compose --upgrade
109112

110113
script:
111-
- git clone https://github.com/django/django.git --depth=1 /tmp/django
114+
- git clone https://github.com/orf/django.git -b add-selenium-hub --depth=1 /tmp/django
112115
- export DJANGO_PATH=/tmp/django
113116
- docker-compose pull --include-deps $COMPOSE_APP || true
114117
- docker-compose build --pull $COMPOSE_APP
@@ -120,7 +123,7 @@ script:
120123
fi
121124
122125
after_failure:
123-
- docker-compose logs $COMPOSE_APP-db || true
126+
- docker-compose logs
124127

125128
deploy:
126129
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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,20 @@ 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+
161175
volumes:
162176
oracle:
177+

0 commit comments

Comments
 (0)