Commit Graph

298 Commits

Author SHA1 Message Date
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
Tommy D. Rossi 170f9499df Update mcp.ts 2025-12-20 14:39:25 +01:00
Tommy D. Rossi 984611e28e Update mcp.ts 2025-12-20 14:39:19 +01:00
Tommy D. Rossi 660fb4c014 nn 2025-12-19 19:23:06 +01:00
Tommy D. Rossi f97052f4f6 refactor tab group sync to be reactive and handle edge cases 2025-12-19 19:22:36 +01:00
Tommy D. Rossi 5b474087eb use waitforloadstate 2025-12-19 19:09:19 +01:00
Tommy D. Rossi b0f786a166 less root crashes in mcp. more error logs. 2025-12-19 19:08:24 +01:00
Tommy D. Rossi 9585f9cced restore viewport stuff 2025-12-19 18:38:31 +01:00
Tommy D. Rossi 04b757a7c8 add support for tab groups. green 2025-12-19 18:34:39 +01:00
Tommy D. Rossi 0940402fed add support for overriding page viewport for playwright 2025-12-19 18:33:23 +01:00
Tommy D. Rossi e73c935da0 add timestamped log files with automatic cleanup 2025-12-19 12:23:42 +01:00
Tommy D. Rossi 71c8507b55 add type-safe event emitter to relay server for CDP message interception 2025-12-19 01:39:57 +01:00
Tommy D. Rossi b7ff5c6d75 run relay server in-process during tests for WS message interception 2025-12-18 16:11:10 +01:00
Tommy D. Rossi daf01b8b69 use XDG data directory for log files 2025-12-18 15:43:55 +01:00
Tommy D. Rossi 951588bfe8 update welcome page colors and add Cursor install button 2025-12-18 15:43:53 +01:00
Tommy D. Rossi a2decc80e0 add distinct icons for disconnected and restricted tab states 2025-12-18 15:43:50 +01:00