Skip to main content
Glama
lucad87

MCP Server - Test Migration (WDIO to Playwright)

by lucad87

compare_frameworks

Compare WDIO and Playwright commands side by side to identify equivalent functionality when migrating test automation projects.

Instructions

Compares WDIO and Playwright commands/concepts side by side. Helps understand equivalent functionality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wdioCommandYesThe WDIO command or pattern to find Playwright equivalent for

Implementation Reference

  • Handler function for the compare_frameworks tool, which compares WDIO commands to their Playwright equivalents.
    export async function handleCompareFrameworks(args) {
      const { wdioCommand } = args;
    
      const mapping = COMMAND_MAPPINGS[wdioCommand];
      
      let playwrightEquivalent;
      if (mapping) {
        playwrightEquivalent = `**${mapping.method}**${mapping.options ? ` with options: ${mapping.options}` : ''}\n\n${mapping.description}`;
      } else {
        const partialMatch = Object.entries(COMMAND_MAPPINGS).find(([key]) => 
          key.toLowerCase().includes(wdioCommand.toLowerCase()) ||
          wdioCommand.toLowerCase().includes(key.toLowerCase())
        );
        
        if (partialMatch) {
          const [key, val] = partialMatch;
          playwrightEquivalent = `Did you mean **${key}**?\n\nPlaywright: **${val.method}**\n\n${val.description}`;
        } else {
          playwrightEquivalent = `No direct mapping found for "${wdioCommand}". 
    
    Common unmapped commands may need custom implementation.
    Check Playwright documentation: https://playwright.dev/docs/api/class-page`;
        }
      }
    
      const relatedCommands = Object.entries(COMMAND_MAPPINGS)
        .filter(([key]) => {
          const category = wdioCommand.split('.')[0];
          return key.startsWith(category) || key.includes(wdioCommand.slice(0, 4));
        })
        .slice(0, 10);
    
      let relatedTable = '';
      if (relatedCommands.length > 0) {
        relatedTable = `\n\n## Related Commands:\n\n| WDIO | Playwright | Description |\n|------|------------|-------------|\n`;
        relatedCommands.forEach(([wdio, pw]) => {
          relatedTable += `| ${wdio} | ${pw.method} | ${pw.description} |\n`;
        });
      }
    
      return {
        content: [{
          type: 'text',
          text: `# WDIO to Playwright Command Comparison
    
    ## WDIO: \`${wdioCommand}\`
    
    ## Playwright Equivalent:
    ${playwrightEquivalent}
    ${relatedTable}
    
    ## Key Differences:
    - Playwright has built-in auto-waiting for most actions
    - Playwright uses Locators with strict mode by default
    - Playwright assertions have built-in retry logic
    - No need for explicit waits in most cases
    - Use \`page.getByTestId()\` with \`data-test-id\` attribute for reliable selectors
    
    Reference: https://playwright.dev/docs/api/class-locator
    `,
        }],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden but fails to disclose output format (table? JSON?), whether the operation is read-only/safe, or any limitations on which commands can be compared. It only describes functional intent, not behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences efficiently convey the core purpose. The second sentence ('Helps understand equivalent functionality') is slightly redundant with the comparison concept but acceptable. No unnecessary verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter lookup tool, the description adequately covers the input purpose but lacks output description (what the side-by-side comparison looks like) and safety guarantees that would be necessary given the absence of annotations and output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage ('The WDIO command or pattern to find Playwright equivalent for'), so the description meets the baseline expectation. It does not add additional semantic context like example commands or input constraints beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verbs ('compares') and resources ('WDIO and Playwright commands/concepts') and clearly distinguishes from siblings like 'migrate_to_playwright' (which performs migration) and 'get_playwright_docs' (which retrieves documentation) by emphasizing side-by-side comparison functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'helps understand equivalent functionality' implies educational/lookup usage, but lacks explicit guidance on when to use this versus 'migrate_to_playwright' (for actual migration) or 'get_playwright_docs' (for general documentation). No prerequisites or exclusions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lucad87/mcp-server-tests-migration'

If you have feedback or need assistance with the MCP directory API, please join our Discord server