From 2e1fb5368bb4af97fdad175fea13a41f24b36ee0 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Sat, 1 Jul 2017 14:06:51 +1000 Subject: [PATCH] Make browser tests work again Save us the embarassement of releasing v2 with broken tests. Signed-off-by: Daniel Axtens Reviewed-by: Stephen Finucane --- patchwork/tests/browser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/patchwork/tests/browser.py b/patchwork/tests/browser.py index 38413d51..3ea3266b 100644 --- a/patchwork/tests/browser.py +++ b/patchwork/tests/browser.py @@ -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) -- 2.47.3