Commit 040dcb43 authored by Jérome Perrin's avatar Jérome Perrin Committed by Xiaowu Zhang

ERP5TypeFunctionalTestCase: tell selenium to ignore certificate errors

We now access zserver behind the backend apache on https:// and this
apache's certificate is not trusted
parent 22c22c17
...@@ -157,14 +157,21 @@ class FunctionalTestRunner: ...@@ -157,14 +157,21 @@ class FunctionalTestRunner:
print("\nSet 'erp5_debug_mode' environment variable to 1" print("\nSet 'erp5_debug_mode' environment variable to 1"
" to use your existing display instead of Xvfb.") " to use your existing display instead of Xvfb.")
xvfb.run() xvfb.run()
firefox_bin = os.environ.get("firefox_bin") capabilities = webdriver.common.desired_capabilities \
firefox_driver = firefox_bin.replace("firefox-slapos", "geckodriver") .DesiredCapabilities.FIREFOX.copy()
firefox_capabilities = webdriver.common.desired_capabilities.DesiredCapabilities.FIREFOX capabilities['marionette'] = True
firefox_capabilities['marionette'] = True # Zope is accessed through apache with a certificate not trusted by firefox
browser = webdriver.Firefox( capabilities['acceptInsecureCerts'] = True
firefox_binary=firefox_bin, # Service workers are disabled on Firefox 52 ESR:
capabilities=firefox_capabilities, # https://bugzilla.mozilla.org/show_bug.cgi?id=1338144
executable_path=firefox_driver) options = webdriver.FirefoxOptions()
options.set_preference('dom.serviceWorkers.enabled', True)
kw = dict(capabilities=capabilities, options=options)
firefox_bin = os.environ.get('firefox_bin')
if firefox_bin:
geckodriver = os.path.join(os.path.dirname(firefox_bin), 'geckodriver')
kw.update(firefox_binary=firefox_bin, executable_path=geckodriver)
browser = webdriver.Firefox(**kw)
start_time = time.time() start_time = time.time()
browser.get(self._getTestURL()) browser.get(self._getTestURL())
......
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