Merge pull request #569 from getmaxun/navigation-fix
feat: add wait until timeout state for navigation
This commit is contained in:
@@ -402,7 +402,7 @@ const handleChangeUrl = async (generator: WorkflowGenerator, page: Page, url: st
|
|||||||
if (url) {
|
if (url) {
|
||||||
await generator.onChangeUrl(url, page);
|
await generator.onChangeUrl(url, page);
|
||||||
try {
|
try {
|
||||||
await page.goto(url);
|
await page.goto(url, { waitUntil: 'networkidle', timeout: 10000 });
|
||||||
logger.log('debug', `Went to ${url}`);
|
logger.log('debug', `Went to ${url}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const { message } = e as Error;
|
const { message } = e as Error;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ async function resetBrowserState(browser: RemoteBrowser): Promise<boolean> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Navigate to blank page to reset state
|
// Navigate to blank page to reset state
|
||||||
await currentPage.goto('about:blank');
|
await currentPage.goto('about:blank', { waitUntil: 'networkidle', timeout: 10000 });
|
||||||
|
|
||||||
// Clear browser storage
|
// Clear browser storage
|
||||||
await currentPage.evaluate(() => {
|
await currentPage.evaluate(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user