Skip to content

Commit

Permalink
Update catch locator.click: Target page, context or browser has been …
Browse files Browse the repository at this point in the history
…closed error

Playwright updated error message which we suppress
  • Loading branch information
aaltat committed May 2, 2024
1 parent d1a2850 commit d5756c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node/playwright-wrapper/interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export async function internalClick(
await locator.click(JSON.parse(options));
return true;
} catch (error: unknown) {
if (error instanceof Error && error.message.startsWith('locator.click: Target closed')) {
logger.warn('Supress locator.click: Target closed error');
if (error instanceof Error && error.message.startsWith('locator.click: Target page, context or browser has been closed')) {
logger.warn('Supress locator.click: Target page, context or browser has been closed error');
return false;
}
throw error;
Expand Down

0 comments on commit d5756c9

Please sign in to comment.