migrate_config
Convert WebDriverIO configuration files to Playwright format while preserving existing settings for test automation migration.
Instructions
Migrates wdio.conf.js to playwright.config.ts. Preserves existing Playwright config if present.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wdioConfig | Yes | Content of wdio.conf.js file | |
| existingPlaywrightConfig | No | Optional existing playwright.config.ts content to merge with |
Implementation Reference
- src/handlers/toolHandlers.js:348-388 (handler)The main handler function `handleMigrateConfig` which parses WDIO config and generates or merges into a Playwright config.
export async function handleMigrateConfig(args) { const { wdioConfig, existingPlaywrightConfig } = args; const wdioSettings = parseWdioConfig(wdioConfig); let playwrightConfig; if (existingPlaywrightConfig) { playwrightConfig = mergePlaywrightConfig(existingPlaywrightConfig, wdioSettings); } else { playwrightConfig = generatePlaywrightConfig(wdioSettings); } return { content: [{ type: 'text', text: `# Playwright Configuration Migration ## Original WDIO Settings Detected: ${JSON.stringify(wdioSettings, null, 2)} ## Generated playwright.config.ts: \`\`\`typescript ${playwrightConfig} \`\`\` ## Migration Notes: 1. Review baseURL and adjust if needed 2. Update testDir to point to your migrated tests 3. The testIdAttribute is set to 'data-test-id' by default 4. Adjust browser projects based on your needs 5. Configure webServer if running local dev server ## Next Steps: 1. Save as \`playwright.config.ts\` in project root 2. Install Playwright: \`npm install -D @playwright/test\` 3. Install browsers: \`npx playwright install\` 4. Run tests: \`npx playwright test\` `, }], }; - src/handlers/tools.js:117-132 (schema)Tool definition and input schema for `migrate_config`.
name: 'migrate_config', description: 'Migrates wdio.conf.js to playwright.config.ts. Preserves existing Playwright config if present.', inputSchema: { type: 'object', properties: { wdioConfig: { type: 'string', description: 'Content of wdio.conf.js file', }, existingPlaywrightConfig: { type: 'string', description: 'Optional existing playwright.config.ts content to merge with', }, }, required: ['wdioConfig'], }, - src/server.js:100-100 (registration)Registration of the `migrate_config` tool in the server.
'migrate_config': handleMigrateConfig,