What can you do with it?

Execute Playwright browser automation code as part of automated workflows. Wrap code for execution or retrieve and run scripts from file storage with session tracking and data binding support.

How to use it?

Basic Command Structure

/wrap-playwright
code: your Playwright automation code

Parameters

  • code: Playwright code to execute (or filename to retrieve)
  • binding data (optional): Step data to pass to the code
  • context service (optional): Session ID for persistent browser state
  • file name (optional): Retrieve code from stored file

Response Format

Returns execution results with success status, any console output, and a session ID for tracking browser sessions.

Examples

Basic Usage

Execute simple automation:

/wrap-playwright
code: await page.goto('https://example.com'); await page.screenshot({path: 'home.png'});

Advanced Usage

Run code from file with context:

/wrap-playwright
file name: automation_script.js
context service: user_session_123
binding data: {"userId": "12345", "action": "login"}

Specific Use Case

Multi-step form automation:

/wrap-playwright
code: await page.fill('#email', 'user@example.com'); await page.fill('#password', 'secure123'); await page.click('#submit');
context service: form_session_456

Notes

  • Code is executed exactly as provided without modifications
  • Session IDs enable state persistence across multiple steps
  • File-based execution retrieves scripts from file storage
  • Supports all standard Playwright operations
  • Returns sessionId for tracking and debugging