chore: support channel and executable path params (#90)
Fixes https://github.com/microsoft/playwright-mcp/issues/89
This commit is contained in:
@@ -36,6 +36,7 @@ test('test tool list', async ({ client, visionClient }) => {
|
||||
'browser_wait',
|
||||
'browser_save_as_pdf',
|
||||
'browser_close',
|
||||
'browser_install',
|
||||
]);
|
||||
|
||||
const { tools: visionTools } = await visionClient.listTools();
|
||||
@@ -53,6 +54,7 @@ test('test tool list', async ({ client, visionClient }) => {
|
||||
'browser_wait',
|
||||
'browser_save_as_pdf',
|
||||
'browser_close',
|
||||
'browser_install',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -353,3 +355,14 @@ test('save as pdf', async ({ client }) => {
|
||||
});
|
||||
expect(response).toHaveTextContent(/^Saved as.*page-[^:]+.pdf$/);
|
||||
});
|
||||
|
||||
test('executable path', async ({ startClient }) => {
|
||||
const client = await startClient({ args: [`--executable-path=bogus`] });
|
||||
const response = await client.callTool({
|
||||
name: 'browser_navigate',
|
||||
arguments: {
|
||||
url: 'data:text/html,<html><title>Title</title><body>Hello, world!</body></html>',
|
||||
},
|
||||
});
|
||||
expect(response).toContainTextContent(`executable doesn't exist`);
|
||||
});
|
||||
|
||||
@@ -71,6 +71,7 @@ export const test = baseTest.extend<Fixtures>({
|
||||
cdpEndpoint: async ({ }, use, testInfo) => {
|
||||
const port = 3200 + (+process.env.TEST_PARALLEL_INDEX!);
|
||||
const browser = await chromium.launchPersistentContext(testInfo.outputPath('user-data-dir'), {
|
||||
channel: 'chrome',
|
||||
args: [`--remote-debugging-port=${port}`],
|
||||
});
|
||||
await use(`http://localhost:${port}`);
|
||||
|
||||
Reference in New Issue
Block a user