mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2026-02-01 20:23:38 +00:00
chore: parse response in tests (#796)
This commit is contained in:
@@ -21,6 +21,7 @@ for (const mcpHeadless of [false, true]) {
|
||||
test.use({ mcpHeadless });
|
||||
test.skip(process.platform === 'linux', 'Auto-detection wont let this test run on linux');
|
||||
test.skip(({ mcpMode, mcpHeadless }) => mcpMode === 'docker' && !mcpHeadless, 'Headed mode is not supported in docker');
|
||||
|
||||
test('browser', async ({ client, server, mcpBrowser }) => {
|
||||
test.skip(!['chrome', 'msedge', 'chromium'].includes(mcpBrowser ?? ''), 'Only chrome is supported for this test');
|
||||
server.route('/', (req, res) => {
|
||||
@@ -40,11 +41,9 @@ for (const mcpHeadless of [false, true]) {
|
||||
},
|
||||
});
|
||||
|
||||
expect(response).toContainTextContent(`Mozilla/5.0`);
|
||||
if (mcpHeadless)
|
||||
expect(response).toContainTextContent(`HeadlessChrome`);
|
||||
else
|
||||
expect(response).not.toContainTextContent(`HeadlessChrome`);
|
||||
expect(response).toHaveResponse({
|
||||
pageState: (mcpHeadless ? expect : expect.not).stringContaining(`HeadlessChrome`),
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user