]> git.openstreetmap.org Git - osqa.git/commitdiff
creating the test_ui command skeleton
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 29 Apr 2011 14:04:05 +0000 (14:04 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 29 Apr 2011 14:04:05 +0000 (14:04 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1010 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/management/commands/test_ui.py [new file with mode: 0644]

diff --git a/forum/management/commands/test_ui.py b/forum/management/commands/test_ui.py
new file mode 100644 (file)
index 0000000..5494066
--- /dev/null
@@ -0,0 +1,30 @@
+import os
+import glob
+import logging
+
+from django.core.management.base import BaseCommand, CommandError
+from django.conf import settings as django_settings
+
+from forum import settings
+
+class Command(BaseCommand):
+    args = '<test1 test2 test3 ...>'
+    help = 'Closes the specified poll for voting'
+
+    def handle(self, *args, **options):
+        # Try to load Selenium.
+        try:
+            import selenium
+            print "Selenium has been successfully loaded"
+        except ImportError:
+            logging.error("Couldn't load selenium")
+            exit("Python Selenium couldn't be loaded: pip install selenium")
+
+        # Tests folder
+        TEST_FOLDER = '%s/forum/skins/%s/tests' % (django_settings.SITE_SRC_ROOT, django_settings.OSQA_DEFAULT_SKIN)
+
+        # Check if the UI tests folder exists
+        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