fix backbone connection (#257)
Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
@@ -14,6 +14,7 @@ class Settings(BaseSettings):
|
|||||||
HAR_PATH: str | None = "./har"
|
HAR_PATH: str | None = "./har"
|
||||||
BROWSER_ACTION_TIMEOUT_MS: int = 5000
|
BROWSER_ACTION_TIMEOUT_MS: int = 5000
|
||||||
BROWSER_SCREENSHOT_TIMEOUT_MS: int = 10000
|
BROWSER_SCREENSHOT_TIMEOUT_MS: int = 10000
|
||||||
|
BROWSER_LOADING_TIMEOUT_MS: int = 12000
|
||||||
MAX_STEPS_PER_RUN: int = 75
|
MAX_STEPS_PER_RUN: int = 75
|
||||||
MAX_NUM_SCREENSHOTS: int = 10
|
MAX_NUM_SCREENSHOTS: int = 10
|
||||||
# Ratio should be between 0 and 1.
|
# Ratio should be between 0 and 1.
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class BrowserState:
|
|||||||
if url:
|
if url:
|
||||||
LOG.info(f"Navigating page to {url} and waiting for 3 seconds")
|
LOG.info(f"Navigating page to {url} and waiting for 3 seconds")
|
||||||
try:
|
try:
|
||||||
await self.page.goto(url)
|
await self.page.goto(url, timeout=settings.BROWSER_LOADING_TIMEOUT_MS)
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
except Error as playright_error:
|
except Error as playright_error:
|
||||||
LOG.exception(f"Error while navigating to url: {str(playright_error)}")
|
LOG.exception(f"Error while navigating to url: {str(playright_error)}")
|
||||||
|
|||||||
Reference in New Issue
Block a user