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:
print("\nSet 'erp5_debug_mode' environment variable to 1"
" to use your existing display instead of Xvfb.")
xvfb.run()
firefox_bin = os.environ.get("firefox_bin")
firefox_driver = firefox_bin.replace("firefox-slapos", "geckodriver")
firefox_capabilities = webdriver.common.desired_capabilities.DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
browser = webdriver.Firefox(
firefox_binary=firefox_bin,
capabilities=firefox_capabilities,
executable_path=firefox_driver)
capabilities = webdriver.common.desired_capabilities \
.DesiredCapabilities.FIREFOX.copy()
capabilities['marionette'] = True
# Zope is accessed through apache with a certificate not trusted by firefox
capabilities['acceptInsecureCerts'] = True
# Service workers are disabled on Firefox 52 ESR:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1338144
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()
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