Commit d36cd0dc authored by Julien Muchembled's avatar Julien Muchembled Committed by Klaus Wölfel

Fix functional tests with FF 52 ESR; fallback on PATH to find executables

This prepares for the removal of --firefox_bin and --xvfb_bin options. The
API between the testnode and the tested software must be exclusively generic.

Conflicts:
	product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
parent 0ed79d1f
...@@ -150,15 +150,19 @@ class FunctionalTestRunner: ...@@ -150,15 +150,19 @@ 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 # Service workers are disabled on Firefox 52 ESR:
browser = webdriver.Firefox( # https://bugzilla.mozilla.org/show_bug.cgi?id=1338144
firefox_binary=firefox_bin, options = webdriver.FirefoxOptions()
capabilities=firefox_capabilities, options.set_preference('dom.serviceWorkers.enabled', True)
executable_path=firefox_driver, kw = dict(capabilities=capabilities, options=options)
firefox_binary=FirefoxBinary(firefox_bin)) 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