Commit 481c2c37 authored by Jérome Perrin's avatar Jérome Perrin

ERP5TypeFunctionalTestCase: dump the correct page in case of failure

parent 959d6669
......@@ -177,18 +177,18 @@ class WebDriverWait(_WebDriverWait):
return super(WebDriverWait, self).until(*args)
except:
logger.exception("unable to find login field, dumping the page")
try:
with open(os.path.join(log_directory, 'page-screenshot.png'), 'wb') as f:
f.write(self._driver.get_screenshot_as_png())
except:
logger.exception("error when taking screenshot")
try:
with open(os.path.join(log_directory, 'page.html'), 'w') as f:
f.write(
self._driver.execute_script(
"return document.getElementById('testSuiteFrame').contentDocument.querySelector('html').innerHTML"))
"return document.getElementById('selenium_myiframe').contentDocument.querySelector('html').innerHTML"))
except:
logger.exception("error when dumping page")
try:
with open(os.path.join(log_directory, 'page-screenshot.png'), 'wb') as f:
f.write(self._driver.get_screenshot_as_png())
except:
logger.exception("error when taking screenshot")
raise
......
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