Context
seleniumboot-mcp generates test code in Java/pytest/Cucumber from recorded sessions. We have wavexis_record which captures interactions as YAML, but we don't generate executable test code from it. Some users want this for test automation workflows.
What needs to happen
New tool wavexis_codegen that takes a recorded session YAML (from wavexis_record) and outputs:
- pytest script — using wavexis directly with assertions
- Playwright Python script — using playwright.sync_api
- Plain Python script — using wavexis directly, no test framework
Implementation
- ~400 lines in wavexis_mcp/tools/data.py (template-based codegen)
- Reuses the existing wavexis_record output format (YAML with actions list)
- Add CodegenInput model to wavexis_mcp/models.py with fields:
- yaml: str (the recorded session YAML)
- format: str ('pytest' | 'playwright' | 'plain')
- output_path: str | None (optional file to write)
- Register tool in the 'data' capability tier
Example
Input (from wavexis_record):
\\yaml
actions:
Output (pytest format):
\\python
import pytest
from wavexis import BrowserOptions, CDPBackend
@pytest.mark.asyncio
async def test_recorded_session():
backend = CDPBackend(BrowserOptions(headless=True))
await backend.launch()
try:
await backend.navigate('https://example.com')
await backend.click('#login')
await backend.type('#username', 'admin@example.com')
await backend.screenshot()
finally:
await backend.close()
\\
Getting started
- Read wavexis_mcp/tools/data.py to see how wavexis_record works
- Read the YAML format it produces
- Create Jinja2 templates (or f-string templates) for each output format
- Add tests in tests/unit/test_data.py
References
Context
seleniumboot-mcp generates test code in Java/pytest/Cucumber from recorded sessions. We have wavexis_record which captures interactions as YAML, but we don't generate executable test code from it. Some users want this for test automation workflows.
What needs to happen
New tool wavexis_codegen that takes a recorded session YAML (from wavexis_record) and outputs:
Implementation
Example
Input (from wavexis_record):
\\yaml
actions:
selector: '#username'
text: admin@example.com
\\
Output (pytest format):
\\python
import pytest
from wavexis import BrowserOptions, CDPBackend
@pytest.mark.asyncio
async def test_recorded_session():
backend = CDPBackend(BrowserOptions(headless=True))
await backend.launch()
try:
await backend.navigate('https://example.com')
await backend.click('#login')
await backend.type('#username', 'admin@example.com')
await backend.screenshot()
finally:
await backend.close()
\\
Getting started
References