Skip to content

Commit 9bdf1c2

Browse files
committed
Merge branch 'main' into hy/bookmark_via_bookmarkmenu
2 parents 504ab85 + 98c0266 commit 9bdf1c2

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

conftest.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,19 @@ def log_content(opt_ci: bool, driver: Firefox, test_name: str) -> None:
3838
artifacts_loc, f"{test_name}_{current_time}_chrome.txt"
3939
)
4040

41-
# Save Chrome context page source
42-
with open(fullpath_chrome, "w", encoding="utf-8") as fh:
43-
with driver.context(driver.CONTEXT_CHROME):
41+
try:
42+
# Save Chrome context page source
43+
with open(fullpath_chrome, "w", encoding="utf-8") as fh:
44+
with driver.context(driver.CONTEXT_CHROME):
45+
output_contents = driver.page_source
46+
fh.write(output_contents)
47+
48+
# Save Content context page source
49+
with open(fullpath_content, "w", encoding="utf-8") as fh:
4450
output_contents = driver.page_source
4551
fh.write(output_contents)
46-
47-
# Save Content context page source
48-
with open(fullpath_content, "w", encoding="utf-8") as fh:
49-
output_contents = driver.page_source
50-
fh.write(output_contents)
52+
except Exception as e:
53+
logging.error(f"Could not log the html content because of {e}")
5154
return
5255

5356

0 commit comments

Comments
 (0)