Commit Graph

313 Commits

Author SHA1 Message Date
Tommy D. Rossi 55d0a3eaec process.env.PLAYWRITER_HOST 2025-12-28 19:07:20 +01:00
Tommy D. Rossi 6cf85ff01d token variable 2025-12-28 19:04:06 +01:00
Tommy D. Rossi eb62f6223a allow changing port and host via options and env 2025-12-28 19:01:08 +01:00
Tommy D. Rossi 98b3986062 fix Runtime.enable race condition with event-based synchronization
Replace arbitrary sleep(200ms) with proper wait for Runtime.executionContextCreated
event in the relay server. This ensures pages are fully ready before Runtime.enable
returns to Playwright, fixing intermittent 'page not found' errors.
2025-12-28 15:16:17 +01:00
Tommy D. Rossi cb2c14b874 Update mcp.test.ts 2025-12-28 12:24:50 +01:00
Tommy D. Rossi 9b115ea2eb set tabs to connecting on extension replace 2025-12-28 12:20:50 +01:00
Tommy D. Rossi b7d0fcf365 Update PLAYWRITER_AGENTS.md 2025-12-28 12:02:55 +01:00
Tommy D. Rossi 806e6331c3 Update mcp.ts 2025-12-27 20:16:10 +01:00
Tommy D. Rossi 30a2f6ea4f Update README.md 2025-12-27 20:10:53 +01:00
Tommy D. Rossi 2e47242e47 Delete .mcp.json 2025-12-27 20:05:45 +01:00
Tommy D. Rossi f1f6b2f015 Update background.ts 2025-12-27 19:51:13 +01:00
Tommy D. Rossi 15e9613aff custom logs files 2025-12-27 19:50:55 +01:00
Tommy D. Rossi e4695e231d add support for remote agent in different host than extension. add
support for editing css.
2025-12-27 18:48:52 +01:00
Tommy D. Rossi e63dc52c68 Update background.ts 2025-12-27 18:33:19 +01:00
Tommy D. Rossi 75c5c2360f Update editor.ts 2025-12-26 19:14:16 +01:00
Tommy D. Rossi 3631cfe233 further reduce sleeps while fixing timing-sensitive tests 2025-12-26 12:41:25 +01:00
Tommy D. Rossi 484020a092 reduce 300ms sleeps to 200ms and 500ms to 300ms 2025-12-26 12:37:11 +01:00
Tommy D. Rossi 6218a80981 reduce 200ms sleeps to 100ms 2025-12-26 12:35:36 +01:00
Tommy D. Rossi 2fea0612b5 use domcontentloaded for accessibility snapshot tests 2025-12-26 12:34:05 +01:00
Tommy D. Rossi 587f90bf6d replace slow external sites with example.com/org and use domcontentloaded 2025-12-26 12:28:50 +01:00
Tommy D. Rossi 3e9517c551 speed up tests by reducing sleeps and replacing slow external sites 2025-12-26 12:23:49 +01:00
Tommy D. Rossi c2d13c0363 add editor. use different port in tests 2025-12-26 00:01:05 +01:00
Tommy D. Rossi c693c7d775 add more debugger methods 2025-12-25 23:37:19 +01:00
Tommy D. Rossi bf74772f4e Update debugger.ts 2025-12-25 22:08:23 +01:00
Tommy D. Rossi 6dadc97779 nicer debugger api 2025-12-25 22:04:19 +01:00
Tommy D. Rossi eb58952578 always use urls 2025-12-25 21:37:38 +01:00
Tommy D. Rossi 91c30bbd3e Add Debugger class tests using CDP session directly
## Debugger Tests Summary

### 1. should use Debugger class to set breakpoints and inspect variables

Tests the core debugging workflow when paused at a debugger statement:

- Creates a Debugger instance with a CDP session
- Verifies isPaused() returns false initially
- Executes code with a debugger statement that pauses execution
- Verifies isPaused() returns true when paused
- Calls getLocation() and verifies:
  - callstack[0].functionName is 'testFunction'
  - sourceContext contains the debugger keyword
- Calls inspectVariables({ scope: 'local' }) and verifies local variables:
  { localVar: "hello", numberVar: 42 }
- Calls evaluate({ expression }) in paused context and verifies it can access local variables
- Calls resume() and verifies isPaused() returns false

### 2. should list scripts with Debugger class

Tests script discovery after page load:

- Navigates to news.ycombinator.com (has external JS files)
- Enables debugger, reloads page to trigger Debugger.scriptParsed events
- Calls listScripts() and verifies:
  - Returns array with scriptId and url properties
  - At least one script exists
- Calls listScripts({ search: 'hn' }) and verifies filtering works

### 3. should manage breakpoints with Debugger class

Tests breakpoint CRUD operations:

- Verifies listBreakpoints() returns empty array initially
- Calls setBreakpoint({ file, line }) and verifies:
  - Returns a breakpoint ID string
  - listBreakpoints() now has 1 entry with correct id, file, line
- Calls deleteBreakpoint({ breakpointId }) and verifies:
  - listBreakpoints() returns empty array again

### 4. should step through code with Debugger class

Tests stepping methods and call stack navigation:

- Executes nested functions (outer calls inner) with debugger in inner
- When paused, verifies getLocation().callstack:
  - Has at least 2 frames
  - Frame 0 is inner, frame 1 is outer
- Calls stepOver() and verifies line number advances
- Calls stepOut() and verifies:
  - Now in outer function (stepped out of inner)
- Calls resume() to finish
2025-12-25 21:33:33 +01:00
Tommy D. Rossi b888301c98 files are urls! 2025-12-25 21:32:56 +01:00
Tommy D. Rossi aed319be9e simpler debugger class 2025-12-25 21:23:09 +01:00
Tommy D. Rossi ccffd9477d document debugger 2025-12-25 21:20:15 +01:00
Tommy D. Rossi 918253dbd6 add comments 2025-12-25 21:13:40 +01:00
Tommy D. Rossi 39ecb0c8b5 Update debugger.ts 2025-12-25 21:01:21 +01:00
Tommy D. Rossi 893b58c87d debugger 2025-12-25 20:56:14 +01:00
Tommy D. Rossi 3d852fcfa7 little prompt thing 2025-12-23 19:03:35 +01:00
Tommy D. Rossi 150ad47307 fix about:blank gray icon and add auto-recovery after extension replacement 2025-12-22 19:29:25 +01:00
Tommy D. Rossi b8b2b468d2 add new test for the cdp session function 2025-12-22 18:17:47 +01:00
Tommy D. Rossi c84edb0afe support about blank 2025-12-22 18:17:32 +01:00
Tommy D. Rossi 581f283cb8 update cdp relay state on page navigation 2025-12-22 18:11:23 +01:00
Tommy D. Rossi 2decaf6b83 refactor: add sleep utility, reduce extension wait to 1s, add comments for CDP race condition 2025-12-21 17:43:11 +01:00
Tommy D. Rossi 9b73ab56f9 bump playwriter 0.0.26 and extension 0.0.54 2025-12-21 17:21:44 +01:00
Tommy D. Rossi 12dbad1ab4 do not send CDP commands too soon. 2025-12-21 17:20:07 +01:00
Tommy D. Rossi a298112437 Update .gitignore 2025-12-21 16:53:36 +01:00
Tommy D. Rossi 43e1862cdb wait 3s for extension after MCP starts relay server 2025-12-21 16:53:19 +01:00
Tommy D. Rossi b44f3ebb02 bump playwriter to 0.0.24: auto-restart server on version mismatch, simplified logging, cross-platform kill 2025-12-21 16:49:40 +01:00
Tommy D. Rossi 6809ebea72 restart ws process if already running with different version 2025-12-21 16:48:07 +01:00
Tommy D. Rossi ba8096fd74 reset tabs on disconnect 2025-12-21 16:26:13 +01:00
Tommy D. Rossi f64e7498cd fix: use os.tmpdir for logs, improving Windows compatibility 2025-12-20 22:13:13 +01:00
Tommy D. Rossi 50aa6199d2 chore: bump to playwriter 0.0.22, extension 0.0.53 2025-12-20 21:33:10 +01:00
Tommy D. Rossi 13031bd03e use green icons. do not tell about reset on timeouts 2025-12-20 21:31:48 +01:00
Tommy D. Rossi 8cf8ed9838 chore: bump playwriter to 0.0.21 2025-12-20 20:26:21 +01:00