test: run tests on MCP server inside Docker (#361)

https://github.com/microsoft/playwright-mcp/issues/346
This commit is contained in:
Max Schmitt
2025-05-07 18:04:20 +02:00
committed by GitHub
parent a115c31953
commit 09ba7989c3
8 changed files with 84 additions and 33 deletions

View File

@@ -18,7 +18,7 @@ import { test, expect } from './fixtures.js';
import fs from 'fs/promises';
import path from 'path';
test('browser_file_upload', async ({ client }) => {
test('browser_file_upload', async ({ client, localOutputPath }) => {
expect(await client.callTool({
name: 'browser_navigate',
arguments: {
@@ -50,7 +50,7 @@ The tool "browser_file_upload" can only be used when there is related modal stat
})).toContainTextContent(`### Modal state
- [File chooser]: can be handled by the "browser_file_upload" tool`);
const filePath = test.info().outputPath('test.txt');
const filePath = localOutputPath('test.txt');
await fs.writeFile(filePath, 'Hello, world!');
{
@@ -96,8 +96,8 @@ The tool "browser_file_upload" can only be used when there is related modal stat
}
});
test('clicking on download link emits download', async ({ startClient }, testInfo) => {
const outputDir = testInfo.outputPath('output');
test('clicking on download link emits download', async ({ startClient, localOutputPath }) => {
const outputDir = localOutputPath('output');
const client = await startClient({
config: { outputDir },
});