Commit 2087dff9 authored by Jérome Perrin's avatar Jérome Perrin

test

parent 060cb34e
...@@ -125,7 +125,7 @@ class BrowserCompatibilityMixin(WebServerMixin): ...@@ -125,7 +125,7 @@ class BrowserCompatibilityMixin(WebServerMixin):
desired_capabilities=self.desired_capabilities) desired_capabilities=self.desired_capabilities)
def tearDown(self): def tearDown(self):
self.driver.close() self.driver.quit()
super(BrowserCompatibilityMixin, self).tearDown() super(BrowserCompatibilityMixin, self).tearDown()
def test_user_agent(self): def test_user_agent(self):
...@@ -173,7 +173,7 @@ class SeleniumServerTestCase(SlapOSInstanceTestCase): ...@@ -173,7 +173,7 @@ class SeleniumServerTestCase(SlapOSInstanceTestCase):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), ) return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class TestBrowserSelection(SeleniumServerTestCase, WebServerMixin): class TestBrowserSelection(WebServerMixin, SeleniumServerTestCase):
def test_firefox(self): def test_firefox(self):
parameter_dict = self.computer_partition.getConnectionParameterDict() parameter_dict = self.computer_partition.getConnectionParameterDict()
webdriver_url = parameter_dict['url'] webdriver_url = parameter_dict['url']
...@@ -235,19 +235,18 @@ class TestBrowserSelection(SeleniumServerTestCase, WebServerMixin): ...@@ -235,19 +235,18 @@ class TestBrowserSelection(SeleniumServerTestCase, WebServerMixin):
def test_parralel_connections(self): def test_parralel_connections(self):
parameter_dict = self.computer_partition.getConnectionParameterDict() parameter_dict = self.computer_partition.getConnectionParameterDict()
webdriver_url = parameter_dict['url'] webdriver_url = parameter_dict['url']
return
queue = multiprocessing.Queue() queue = multiprocessing.Queue()
def _test(q, server_url): def _test(q, server_url):
driver = webdriver.Remote( driver = webdriver.Remote(
command_executor=webdriver_url, command_executor=webdriver_url,
desired_capabilities=DesiredCapabilities.FIREFOX) # XXX
# XXX we need to sleep a bit to wait for browser to be ready before using it, otherwise selenium crash desired_capabilities= dict(DesiredCapabilities.FIREFOX, version='52.9.0esr')) #DesiredCapabilities.FIREFOX)
sleep(2) try:
driver.get(server_url) driver.get(server_url)
q.put(driver.title == 'Test page') q.put(driver.title == 'Test page')
driver.quit() finally:
driver.quit()
nb_workers = 10 nb_workers = 10
workers = [] workers = []
...@@ -281,9 +280,10 @@ class TestChrome69(BrowserCompatibilityMixin, SeleniumServerTestCase): ...@@ -281,9 +280,10 @@ class TestChrome69(BrowserCompatibilityMixin, SeleniumServerTestCase):
user_agent = 'Chrome/69.0.3497.0' user_agent = 'Chrome/69.0.3497.0'
#del TestFirefox52 del TestChrome69
del TestFirefox52
del TestFirefox60 del TestFirefox60
del TestBrowserSelection #del TestBrowserSelection
# more test: # more test:
# XXX run ERP5 test ! # XXX run ERP5 test !
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