Compare commits

...

1 Commits

Author SHA1 Message Date
dgtlmoon
3d798bfa2e Update other methods to use screenshot 2025-04-09 17:23:06 +02:00

View File

@@ -60,7 +60,7 @@ class fetcher(Fetcher):
def screenshot_step(self, step_n=''): def screenshot_step(self, step_n=''):
super().screenshot_step(step_n=step_n) super().screenshot_step(step_n=step_n)
screenshot = self.page.screenshot(type='jpeg', full_page=True, quality=int(os.getenv("SCREENSHOT_QUALITY", 72))) screenshot = capture_full_page(self.page)
if self.browser_steps_screenshot_path is not None: if self.browser_steps_screenshot_path is not None:
destination = os.path.join(self.browser_steps_screenshot_path, 'step_{}.jpeg'.format(step_n)) destination = os.path.join(self.browser_steps_screenshot_path, 'step_{}.jpeg'.format(step_n))
@@ -164,9 +164,7 @@ class fetcher(Fetcher):
raise PageUnloadable(url=url, status_code=None, message=str(e)) raise PageUnloadable(url=url, status_code=None, message=str(e))
if self.status_code != 200 and not ignore_status_codes: if self.status_code != 200 and not ignore_status_codes:
screenshot = self.page.screenshot(type='jpeg', full_page=True, screenshot = capture_full_page(self.page)
quality=int(os.getenv("SCREENSHOT_QUALITY", 72)))
raise Non200ErrorCodeReceived(url=url, status_code=self.status_code, screenshot=screenshot) raise Non200ErrorCodeReceived(url=url, status_code=self.status_code, screenshot=screenshot)
if not empty_pages_are_a_change and len(self.page.content().strip()) == 0: if not empty_pages_are_a_change and len(self.page.content().strip()) == 0: