File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 37
37
# If False, only the downloads from the most recent run will be saved locally.
38
38
ARCHIVE_EXISTING_DOWNLOADS = False
39
39
40
+ # If True, the last page screenshot will include the <body> and background.
41
+ # If False, the last page screenshot will only include the <body> section.
42
+ # Depending on the screen size, including a background could make the <body>
43
+ # appear very small in the screenshot, which may require manually zooming in
44
+ # on the <body> to see page details if you decide to include the background.
45
+ SCREENSHOT_WITH_BACKGROUND = False
46
+
40
47
# Default names for files saved during test failures.
41
48
# (These files will get saved to the "latest_logs/" folder.)
42
49
SCREENSHOT_NAME = "screenshot.png"
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ def set_settings(settings_file):
75
75
settings .ARCHIVE_EXISTING_LOGS = override_settings [key ]
76
76
elif key == "ARCHIVE_EXISTING_DOWNLOADS" :
77
77
settings .ARCHIVE_EXISTING_DOWNLOADS = override_settings [key ]
78
+ elif key == "SCREENSHOT_WITH_BACKGROUND" :
79
+ settings .SCREENSHOT_WITH_BACKGROUND = override_settings [key ]
78
80
elif key == "SCREENSHOT_NAME" :
79
81
settings .SCREENSHOT_NAME = override_settings [key ]
80
82
elif key == "BASIC_INFO_NAME" :
Original file line number Diff line number Diff line change @@ -14030,7 +14030,17 @@ def __set_last_page_screenshot(self):
14030
14030
ignore_test_time_limit=True,
14031
14031
)
14032
14032
try:
14033
- self.__last_page_screenshot = element.screenshot_as_base64
14033
+ if (
14034
+ hasattr(settings, "SCREENSHOT_WITH_BACKGROUND")
14035
+ and settings.SCREENSHOT_WITH_BACKGROUND
14036
+ ):
14037
+ self.__last_page_screenshot = (
14038
+ self.driver.get_screenshot_as_base64()
14039
+ )
14040
+ else:
14041
+ self.__last_page_screenshot = (
14042
+ element.screenshot_as_base64
14043
+ )
14034
14044
except Exception:
14035
14045
try:
14036
14046
self.__last_page_screenshot = (
You can’t perform that action at this time.
0 commit comments