forked from EFForg/privacybadger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_selenium_tests.sh
executable file
·34 lines (30 loc) · 1.28 KB
/
run_selenium_tests.sh
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
#!/bin/bash
pushd .
cd ..
make lint
if [ $? != 0 ]; then
echo "Linting errors"
exit 1
fi
make travisbuild # pack the extension
ext_path=`ls -1tr $PWD/*.crx | tail -n 1` # get the last modified crx
popd
# trap 'rm -rf PBTESTENV' EXIT # Clean virtualenv dir on exit
# virtualenv PBTESTENV
# source PBTESTENV/bin/activate
pip install -r sel_requirements.txt
if [ $BROWSER == "firefox" ]; then
# only needed for ff, and only works for python 2
pip install marionette_driver
fi
# TODO: take command line arguments to set the following environment variables
export PB_EXT_PATH=$ext_path # extension on this path will be used in the tests
# if this var is empty, extension base dir will be searched for the last modified .crx.
echo "Browesr path: "$BROWSER_BIN
echo "Extension path: "$PB_EXT_PATH
# export BROWSER_BIN="/path/to/chrome" # Optional.
# If BROWSER_BIN is empty, Selenium will pick the default binary for Chrome.
# To run tests with Chromium (instead of Google Chrome) export BROWSER_BIN="/usr/bin/chromium-browser"
export ENABLE_XVFB=1 # run the tests headless using Xvfb. Set 0 to disable
# for i in {1..20}; do echo "Run "$i; py.test -s -v --durations=10 selenium; done # autodiscover and run the tests
py.test -s -v --durations=10 selenium # autodiscover and run the tests