Compare commits
1 Commits
0.49.17
...
browserste
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b28d5bfb46 |
@@ -95,6 +95,9 @@ class Fetcher():
|
|||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def screenshot_step(self, step_n):
|
def screenshot_step(self, step_n):
|
||||||
|
if self.browser_steps_screenshot_path and not os.path.isdir(self.browser_steps_screenshot_path):
|
||||||
|
logger.debug(f"> Creating data dir {self.browser_steps_screenshot_path}")
|
||||||
|
os.mkdir(self.browser_steps_screenshot_path)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@@ -168,5 +171,8 @@ class Fetcher():
|
|||||||
if os.path.isfile(f):
|
if os.path.isfile(f):
|
||||||
os.unlink(f)
|
os.unlink(f)
|
||||||
|
|
||||||
def save_step_html(self, param):
|
def save_step_html(self, step_n):
|
||||||
|
if self.browser_steps_screenshot_path and not os.path.isdir(self.browser_steps_screenshot_path):
|
||||||
|
logger.debug(f"> Creating data dir {self.browser_steps_screenshot_path}")
|
||||||
|
os.mkdir(self.browser_steps_screenshot_path)
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class fetcher(Fetcher):
|
|||||||
self.proxy['password'] = parsed.password
|
self.proxy['password'] = parsed.password
|
||||||
|
|
||||||
def screenshot_step(self, step_n=''):
|
def screenshot_step(self, 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 = self.page.screenshot(type='jpeg', full_page=True, quality=int(os.getenv("SCREENSHOT_QUALITY", 72)))
|
||||||
|
|
||||||
if self.browser_steps_screenshot_path is not None:
|
if self.browser_steps_screenshot_path is not None:
|
||||||
@@ -67,6 +68,7 @@ class fetcher(Fetcher):
|
|||||||
f.write(screenshot)
|
f.write(screenshot)
|
||||||
|
|
||||||
def save_step_html(self, step_n):
|
def save_step_html(self, step_n):
|
||||||
|
super().save_step_html(step_n=step_n)
|
||||||
content = self.page.content()
|
content = self.page.content()
|
||||||
destination = os.path.join(self.browser_steps_screenshot_path, 'step_{}.html'.format(step_n))
|
destination = os.path.join(self.browser_steps_screenshot_path, 'step_{}.html'.format(step_n))
|
||||||
logger.debug(f"Saving step HTML to {destination}")
|
logger.debug(f"Saving step HTML to {destination}")
|
||||||
|
|||||||
Reference in New Issue
Block a user