format
This commit is contained in:
@@ -18,6 +18,7 @@ prompt: |
|
||||
|
||||
- Always reuse an existing Framer tab when possible (do not open a new page each run).
|
||||
Use this pattern to pick an existing page first, then navigate only if needed:
|
||||
|
||||
```bash
|
||||
playwriter -s 1 -e "const target = 'https://framer.com/projects/unframer-source--XOxwdyyCrFEE9uKnKFPq-6gX7n?node=augiA20Il'; const framerPage = context.pages().find((p) => p.url().includes('framer.com/projects/unframer-source')) || page; if (!framerPage.url().includes('framer.com/projects/unframer-source')) { await framerPage.goto(target, { waitUntil: 'domcontentloaded' }); } console.log(framerPage.url());"
|
||||
```
|
||||
@@ -32,6 +33,7 @@ playwriter -s 1 -e "const target = 'https://framer.com/projects/unframer-source-
|
||||
- Press Command+K to open the command palette.
|
||||
|
||||
- Verify the palette is open (look for the command dialog and MCP entry in the snapshot output):
|
||||
|
||||
```bash
|
||||
playwriter -s 1 -e "console.log(await snapshot({ page, search: /dialog|Search…|MCP/ }));"
|
||||
```
|
||||
@@ -39,31 +41,37 @@ playwriter -s 1 -e "console.log(await snapshot({ page, search: /dialog|Search…
|
||||
- Search for **MCP**, press Enter, then wait about 1 second for the plugin iframe to appear.
|
||||
|
||||
- Verify the plugin iframe exists (should include `plugins.framercdn.com`):
|
||||
|
||||
```bash
|
||||
playwriter -s 1 -e "const iframes = await page.locator('iframe').all(); for (const f of iframes) { console.log(await f.getAttribute('src')); }"
|
||||
```
|
||||
|
||||
- Wait until the MCP iframe is present (verifies the action worked):
|
||||
|
||||
```bash
|
||||
playwriter -s 1 -e "const iframe = page.locator(\"iframe[src*='plugins.framercdn.com']\"); await iframe.first().waitFor({ timeout: 10000 }); console.log('iframe ready');"
|
||||
```
|
||||
|
||||
- Grab the iframe’s locator by URL:
|
||||
|
||||
```bash
|
||||
playwriter -s 1 -e "const iframe = page.locator(\"iframe[src*='plugins.framercdn.com']\"); console.log(await iframe.count());"
|
||||
```
|
||||
|
||||
- Run the accessibility snapshot on that iframe using `contentFrame()` (FrameLocator is auto-resolved to Frame):
|
||||
|
||||
```bash
|
||||
playwriter -s 1 -e "const frame = await page.locator(\"iframe[src*='plugins.framercdn.com']\").contentFrame(); console.log(await snapshot({ page, frame }));"
|
||||
```
|
||||
|
||||
- Alternative: use `page.frames()` to get the Frame directly:
|
||||
|
||||
```bash
|
||||
playwriter -s 1 -e "const frame = page.frames().find(f => f.url().includes('plugins.framercdn.com')); console.log(await snapshot({ page, frame }));"
|
||||
```
|
||||
|
||||
- Validate the snapshot contains MCP UI text (confirms the panel is actually loaded):
|
||||
|
||||
```bash
|
||||
playwriter -s 1 -e "const frame = await page.locator(\"iframe[src*='plugins.framercdn.com']\").contentFrame(); console.log(await snapshot({ page, frame, search: /Control Framer with MCP|Login With Google/ }));"
|
||||
```
|
||||
|
||||
@@ -134,9 +134,7 @@ The env vars tell the MCP to skip starting a local relay and connect to the remo
|
||||
```typescript
|
||||
import { chromium } from 'playwright-core'
|
||||
|
||||
const browser = await chromium.connectOverCDP(
|
||||
'wss://my-machine-tunnel.traforo.dev/cdp/session1?token=MY_SECRET_TOKEN'
|
||||
)
|
||||
const browser = await chromium.connectOverCDP('wss://my-machine-tunnel.traforo.dev/cdp/session1?token=MY_SECRET_TOKEN')
|
||||
const page = browser.contexts()[0].pages()[0]
|
||||
await page.goto('https://example.com')
|
||||
// Don't call browser.close() - it would close the user's Chrome
|
||||
@@ -176,11 +174,11 @@ done
|
||||
|
||||
### Environment variables
|
||||
|
||||
| Variable | Description |
|
||||
|---|---|
|
||||
| `PLAYWRITER_HOST` | Remote relay URL (e.g. `https://x-tunnel.traforo.dev`) or IP (e.g. `192.168.1.10`) |
|
||||
| `PLAYWRITER_TOKEN` | Authentication token for the relay server |
|
||||
| `PLAYWRITER_PORT` | Override relay port (default: `19988`, not needed with traforo) |
|
||||
| Variable | Description |
|
||||
| ------------------ | ---------------------------------------------------------------------------------- |
|
||||
| `PLAYWRITER_HOST` | Remote relay URL (e.g. `https://x-tunnel.traforo.dev`) or IP (e.g. `192.168.1.10`) |
|
||||
| `PLAYWRITER_TOKEN` | Authentication token for the relay server |
|
||||
| `PLAYWRITER_PORT` | Override relay port (default: `19988`, not needed with traforo) |
|
||||
|
||||
### Recommendations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user