I have a problem to run selenium tests with separate django command. Default “test” command looks into “tests” folder and runs unittests ok. Problem is, i want to make folder “seleniumtests” and place there test files to run them with command “test_selenium”. And i want this command to do the same as default django “test” but in another dir.
The tests.py with selenium:
from django_liveserver.testcases import LiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
class MySeleniumTests(LiveServerTestCase):
# fixtures = ['test-data.json']
@classmethod
def setUpClass(cls):
cls.selenium = WebDriver()
super(MySeleniumTests, cls).setUpClass()
@classmethod
def tearDownClass(cls):
super(MySeleniumTests, cls).tearDownClass()
cls.selenium.quit()
def test_admin(self):
self.selenium.get(self.live_server_url +'/admin/')
self.assertIn("Django", self.selenium.title)
Follow this tutorial on how to put your tests into folders: http://www.pioverpi.net/2010/03/10/organizing-django-tests-into-folders/
in general: