dump html if python installation fails

This commit is contained in:
fbsanchez 2022-02-02 10:19:24 +01:00
parent 8f364c3914
commit 934f2087fa

View File

@ -3,12 +3,14 @@
import os
from pyvirtualdisplay import Display
from selenium import webdriver
from exceptions import AssertionError
# Are we running headless?
if ('DISPLAY' not in os.environ):
display = Display(visible=0, size=(1920, 1080))
display.start()
try:
# Go to the installation page.
browser = webdriver.Firefox(timeout=15)
browser.implicitly_wait(5)
@ -30,6 +32,9 @@ browser.find_element_by_xpath("//*[@id='step5']").click()
browser.implicitly_wait(5)
assert("Installation complete" in browser.page_source)
browser.find_element_by_name("rn_file").click()
except AssertionError:
print(browser.page_source)
# Clean-up
browser.quit()