Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(test): unflake MCP cli-core 'click link' on Firefox (#42306)

microsoft-playwright-automation[bot]75d6aebfebeb
diff --git a/tests/mcp/cli-core.spec.ts b/tests/mcp/cli-core.spec.ts
index 264458dccb..790ca85d6f 100644
--- a/tests/mcp/cli-core.spec.ts
+++ b/tests/mcp/cli-core.spec.ts
@@ -54,10 +54,10 @@ await page.getByRole('button', { name: 'Submit' }).click();
\`\`\``);
});
-test('click link', async ({ cli, server }) => {
+test('click link', async ({ cli, server, mcpBrowser }) => {
server.setContent('/', `<a href="/hello-world">Hello, world!</a>`, 'text/html');
- const { snapshot } = await cli('open', server.PREFIX);
+ const { snapshot } = await cli('open', server.PREFIX, { env: { PLAYWRIGHT_MCP_TIMEOUT_ACTION: mcpBrowser === 'firefox' ? '30000' : '' } });
expect(snapshot).toContain(`- link \"Hello, world!\" [ref=e2]`);
const { output: clickOutput, snapshot: clickSnapshot } = await cli('click', 'e2');