generate_migration_report
Generate a migration report in markdown format to document test automation migration from WebDriverIO to Playwright, including test files, tags, status, and statistics.
Instructions
Generates a comprehensive migration report as a markdown file. Includes test files, tags, migration status, and statistics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| migratedTests | Yes | JSON string array of migrated test information with file paths, tags, and status | |
| projectName | No | Name of the project for the report header |
Implementation Reference
- src/handlers/toolHandlers.js:438-462 (handler)Handler function for 'generate_migration_report' tool. It receives the test data, parses it, and calls the generateMigrationReport utility.
export async function handleGenerateMigrationReport(args) { const { migratedTests, projectName = 'Test Migration' } = args; let tests = []; try { tests = JSON.parse(migratedTests); } catch (e) { return { content: [{ type: 'text', text: 'Error: migratedTests must be a valid JSON array', }], isError: true, }; } const report = generateMigrationReport(tests, projectName); return { content: [{ type: 'text', text: report, }], }; } - src/utils/report.js:12-83 (helper)Utility function that generates the actual markdown migration report.
export function generateMigrationReport(tests, projectName = 'Test Migration') { const now = new Date().toISOString(); const stats = calculateMigrationStats(tests); const tagSummary = generateTagSummary(tests); const fileList = generateFileList(tests); const testRows = generateTestRows(tests); return `# ${projectName} - Migration Report **Generated:** ${now} **Tool Version:** MCP Test Migration Server v2.1.0 --- ## ๐ Migration Summary | Metric | Count | |--------|-------| | Total Tests | ${stats.total} | | Migrated | ${stats.migrated} | | Pending | ${stats.pending} | | Failed | ${stats.failed} | | **Success Rate** | **${stats.successRate}%** | --- ## ๐ท๏ธ Tags Summary ${tagSummary} --- ## ๐ Files ### Migrated Files ${fileList.migrated} ### Pending Files ${fileList.pending} ### Failed Files ${fileList.failed} --- ## ๐ Detailed Test List | Original File | Migrated File | Status | Tags | |--------------|---------------|--------|------| ${testRows} --- ## ๐ง Next Steps 1. Review migrated tests for any manual adjustments 2. Run tests: \`npx playwright test\` 3. Run specific tags: \`npx playwright test --grep @smoke\` 4. View report: \`npx playwright show-report\` --- ## ๐ Resources - [Playwright Documentation](https://playwright.dev/docs/intro) - [Playwright Test Annotations](https://playwright.dev/docs/test-annotations) - [Playwright Locators](https://playwright.dev/docs/locators) `; } - src/server.js:102-102 (registration)Tool registration for 'generate_migration_report' in the server implementation.
'generate_migration_report': handleGenerateMigrationReport,