Commit 158a3044 by Andy Armstrong

Merge pull request #743 from edx/andya/acceptance-test-commands

Add make commands for acceptance and a11y testing
parents 3d7c7c31 7e2a9b39
......@@ -64,3 +64,9 @@ test-js: render-templates
test-js-debug: render-templates
./scripts/js-debugger.sh
test-acceptance:
./scripts/test-acceptance.sh tests
test-a11y:
./scripts/test-acceptance.sh accessibility
......@@ -35,12 +35,17 @@ virtualenv venv
source venv/bin/activate
pip install -r requirements/test-acceptance.txt
cd test/acceptance
python tests.py
######### Run acceptance tests #########
make test-acceptance
######### Run accessibility tests #########
# Unset SELENIUM_HOST so that bok-choy doesn't try to use saucelabs
unset SELENIUM_HOST
# AutoAuthPage times out in PhantomJS when using https, switch to use http
# AutoAuthPage times out in PhantomJS when using https, so switch to use http
export BASE_URL="http://${BASIC_AUTH_USER}:${BASIC_AUTH_PASSWORD}@${TEST_HOST}"
export SELENIUM_BROWSER=phantomjs
python accessibility.py
make test-a11y
#!/usr/bin/env bash
############################################################
#
# test-acceptance.sh
#
# Runs acceptance tests from a specified file against
# an edX platform sandbox.
#
# Note: this script is invoked from the ORA Makefile and
# should not normally be used directly.
#
# Usage:
#
# ./test-acceptance.sh {test_file}
#
############################################################
cd `dirname $BASH_SOURCE` && cd ..
if [ -z "$BASE_URL" ]; then
echo "Error: BASE_URL must be set to point to your sandbox"
exit 1
fi
mkdir -p test/logs
cd test/logs
export SELENIUM_BROWSER=phantomjs
test_name="${1:-acceptance}"
echo "Running acceptance tests from ${test_name}.py against the sandbox..."
python ../acceptance/${test_name}.py
......@@ -18,12 +18,11 @@ To use the tests:
pip install -r requirements/test-acceptance.txt
2. Prepare for tests
2. Specify your sandbox location
.. code:: bash
cd edx-ora2/test/acceptance
export BASE_URL=https://{USER}:{PASSWORD}@example.com
export BASE_URL=https://{USER}:{PASSWORD}@{SANDBOX}
3. Run the tests
......@@ -31,11 +30,10 @@ To run the acceptance tests:
.. code:: bash
python tests.py
make test-acceptance
To run the accessibility tests, which must be run with phantomjs as the browser:
To run the accessibility tests:
.. code:: bash
export SELENIUM_BROWSER=phantomjs
python accessibility.py
make test-a11y
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment