From 831cbcedffa7c951b24a3a0d2b1ebda07167f692 Mon Sep 17 00:00:00 2001 From: jordan Date: Fri, 29 Apr 2011 17:12:40 +0000 Subject: [PATCH] call all matching Selenium UI tests git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1011 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/management/commands/test_ui.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/forum/management/commands/test_ui.py b/forum/management/commands/test_ui.py index 5494066..500cfde 100644 --- a/forum/management/commands/test_ui.py +++ b/forum/management/commands/test_ui.py @@ -1,6 +1,7 @@ import os import glob import logging +import subprocess from django.core.management.base import BaseCommand, CommandError from django.conf import settings as django_settings @@ -27,4 +28,18 @@ class Command(BaseCommand): if os.path.exists(TEST_FOLDER): print 'Loading UI tests from %s' % TEST_FOLDER else: - exit("UI tests folder couldn't be loaded") \ No newline at end of file + exit("UI tests folder couldn't be loaded") + + # Loop through all args and try to get the python test files that match + print args + files = [] + for arg in args: + matching_files = glob.glob('%s/%s.py' % (TEST_FOLDER, arg)) + for matching_file in matching_files: + files.append(matching_file) + + # Loop through all test files + for file in files: + file_name = file.split('/')[-1] + print "Starting test %s" % file_name + child = subprocess.Popen('python %s' % file, shell=True) -- 2.39.5