-
Notifications
You must be signed in to change notification settings - Fork 161
/
run-selenium-tests.bash
executable file
·56 lines (43 loc) · 1.16 KB
/
run-selenium-tests.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
# This will run Selenium tests against deformdemo.
# https://github.com/Pylons/deformdemo
#
# This script assumes you have checked out deformdemo to a folder named
# `deformdemo_functional_tests`
# If there is no checkout, then a fresh checkout is made.
# This allows you to check out a particular pull request to test against it.
set -u
set -e
set -x
function cleanup()
{
kill $SERVER_PID
# Cleanup locales
cd ..
git checkout -- deform/locale/*
}
CLEAN=true
# Add the deform checkout to your PATH, assuming you installed Firefox and
# geckodriver in the same location.
export PATH="${PWD}:$PATH"
# Checkout deformdemo
if [ ! -d deformdemo_functional_tests ] ; then
git clone https://github.com/pylons/deformdemo.git deformdemo_functional_tests
fi
# Locales are needed for deformdemo tests
./i18n.sh
# We need to reinstall deform with translations included
pip install -e .
# Let's go for the demo
cd deformdemo_functional_tests
pip install -e .
pip freeze
# Run test server
pserve demo.ini &
SERVER_PID=$!
# Even if tests crash make sure we quit pserve
trap cleanup EXIT
# Run functional test suite against test server
pytest "$@"
exit 0