From 3ad391c0eb574e2bd7d74bd6dd8eb5e8b05bdd0e Mon Sep 17 00:00:00 2001 From: Peter Belanyi Date: Tue, 15 Apr 2014 14:12:30 +0200 Subject: [PATCH] Add CLI option for running Selenium tests headless - Add requirement for xfvbwrapper - Add CLI option for running tests headless Based on horizon patch https://review.openstack.org/79764 Change-Id: I519621ad9cfde749a41b1f3a2a44432a2086d996 --- run_tests.sh | 9 ++++++++- test-requirements.txt | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 231462fa9..13c2e8ee4 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -6,7 +6,7 @@ set -o errexit # Increment me any time the environment should be rebuilt. # This includes dependency changes, directory renames, etc. # Simple integer sequence: 1, 2, 3... -environment_version=41 +environment_version=42 #--------------------------------------------------------# function usage { @@ -31,6 +31,7 @@ function usage { echo " Implies -V if -N is not set." echo " --only-selenium Run only the Selenium unit tests" echo " --with-selenium Run unit tests including Selenium tests" + echo " --selenium-headless Run Selenium tests headless" echo " --runserver Run the Django development server for" echo " openstack_dashboard in the virtual" echo " environment." @@ -69,6 +70,7 @@ restore_env=0 runserver=0 only_selenium=0 with_selenium=0 +selenium_headless=0 testopts="" testargs="" with_coverage=0 @@ -113,6 +115,7 @@ function process_option { --compilemessages) compilemessages=1;; --only-selenium) only_selenium=1;; --with-selenium) with_selenium=1;; + --selenium-headless) selenium_headless=1;; --docs) just_docs=1;; --runserver) runserver=1;; --backup-environment) backup_env=1;; @@ -292,6 +295,10 @@ function run_tests { export SKIP_UNITTESTS=1 fi + if [ $selenium_headless -eq 1 ]; then + export SELENIUM_HEADLESS=1 + fi + if [ -z "$testargs" ]; then run_tests_all else diff --git a/test-requirements.txt b/test-requirements.txt index c33fe492a..7e85e261b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,6 +11,7 @@ nosexcover openstack.nose_plugin>=0.7 nosehtmloutput>=0.0.3 selenium +xvfbwrapper # Docs Requirements sphinx>=1.1.2,<1.2 # for bug 1091333, remove after sphinx >1.1.3 is released.