Add multi-user WordPress Puppeteer demo scaffolding - #2
Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| case 'wait': { | ||
| const duration = action.scrollY ?? 1000; | ||
| await page.waitForTimeout(duration); | ||
| return; |
There was a problem hiding this comment.
Bug: Wait action reuses scrollY property for duration
The wait action uses action.scrollY to specify its duration, but scrollY is semantically intended for scroll position as used in the scroll action. The Action interface lacks a dedicated duration property, so anyone using the wait action type would need to confusingly specify the wait time via scrollY. This will cause unexpected behavior and makes the API unintuitive.
Additional Locations (1)
| document.body.appendChild(cursor); | ||
|
|
||
| window.__moveFakeCursor = (x, y) => { | ||
| cursor.style.transform = `translate(${x}px, ${y}px)`; |
There was a problem hiding this comment.
Bug: Fake cursor position offset by half its size
The __moveFakeCursor function replaces the CSS transform entirely with translate(${x}px, ${y}px), discarding the initial translate(-50%, -50%) that centers the cursor. This positions the cursor's top-left corner at (x, y) instead of its center. Since the cursor is 12x12 pixels, the visual indicator appears 6 pixels to the right and down from where clicks actually occur via page.mouse.move(), causing visible misalignment in recordings.
Summary
Testing
Codex Task
Note
Scaffolds a TypeScript Puppeteer demo simulating four WordPress collaborators with timed actions, recording-focused helpers, and env-driven setup.
src/scenario.ts(author/designer/editor/proofreader) with navigation, typing, clicks, scrolling, and file upload.src/orchestrator.tsgroups actions per user and starts runs with a 3s countdown; keeps browser open for recording.src/puppeteerHelpers.tsfor login, navigation, cursor movement, action execution, and window focus;src/fakeCursor.tsinjects a visible cursor.src/config.tsloads.env, validatesPRIMARY_USER,HEADLESS;src/users.tsbuilds user creds from env.src/runScenario.tsand sample assetassets/sample-image.jpgfor uploads..env.exampleand updated.gitignore.README.mdwith setup/run/recording guidance.package.json(scripts, deps) andtsconfig.jsonfor Node/CommonJS build.Written by Cursor Bugbot for commit 6f2a23a. This will update automatically on new commits. Configure here.