]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Make browser tests work again
authorDaniel Axtens <dja@axtens.net>
Sat, 1 Jul 2017 04:06:51 +0000 (14:06 +1000)
committerStephen Finucane <stephen@that.guru>
Tue, 4 Jul 2017 12:54:46 +0000 (13:54 +0100)
Save us the embarassement of releasing v2 with broken tests.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Stephen Finucane <stephen@that.guru>
patchwork/tests/browser.py

index 38413d5130cde330d39e395db87accba49e03043..3ea3266b8f4f40e29ec4784e135be5851cce6440 100644 (file)
@@ -30,6 +30,7 @@ from selenium.common.exceptions import (
     TimeoutException)
 from selenium import webdriver
 from selenium.webdriver.support.ui import WebDriverWait
+from selenium.webdriver.chrome.options import Options
 
 
 class Wait(WebDriverWait):
@@ -110,8 +111,14 @@ class SeleniumTestCase(StaticLiveServerTestCase):
         if self.browser == 'firefox':
             self.selenium = webdriver.Firefox()
         if self.browser == 'chrome':
+            chrome_options = Options()
+            # chrome's aggressive sandboxing doesn't work well with
+            # docker so disable the sandbox. We're only looking at our
+            # own site so it should be safe enough
+            chrome_options.add_argument("--no-sandbox")
             self.selenium = webdriver.Chrome(
-                service_args=['--verbose', '--log-path=selenium.log']
+                service_args=['--verbose', '--log-path=selenium.log'],
+                chrome_options=chrome_options
             )
 
         mkdir(self._SCREENSHOT_DIR)