Skip to content

Add multi-user WordPress Puppeteer demo scaffolding - #2

Open
dabowman wants to merge 1 commit into
transform-locallyfrom
codex/build-multi-user-puppeteer-demo-for-wordpress
Open

Add multi-user WordPress Puppeteer demo scaffolding#2
dabowman wants to merge 1 commit into
transform-locallyfrom
codex/build-multi-user-puppeteer-demo-for-wordpress

Conversation

@dabowman

@dabowman dabowman commented Nov 30, 2025

Copy link
Copy Markdown
Owner

Summary

  • scaffold a TypeScript Puppeteer demo simulating four WordPress collaborators with shared scenario data
  • add reusable helpers for login, navigation, fake cursor injection, and timed orchestration with primary-user focus for recordings
  • provide env variable template, placeholder upload asset, README guidance, and demo script configuration

Testing

  • npm install (fails: registry returned 403 for @types/node; may require proxy/auth configuration)

Codex Task


Note

Scaffolds a TypeScript Puppeteer demo simulating four WordPress collaborators with timed actions, recording-focused helpers, and env-driven setup.

  • Demo orchestration (Puppeteer/TypeScript):
    • Add timed multi-user scenario src/scenario.ts (author/designer/editor/proofreader) with navigation, typing, clicks, scrolling, and file upload.
    • Orchestrator src/orchestrator.ts groups actions per user and starts runs with a 3s countdown; keeps browser open for recording.
    • Helpers src/puppeteerHelpers.ts for login, navigation, cursor movement, action execution, and window focus; src/fakeCursor.ts injects a visible cursor.
    • Config and users: src/config.ts loads .env, validates PRIMARY_USER, HEADLESS; src/users.ts builds user creds from env.
    • Entry src/runScenario.ts and sample asset assets/sample-image.jpg for uploads.
  • Project setup:
    • New .env.example and updated .gitignore.
    • Replace README.md with setup/run/recording guidance.
    • Update package.json (scripts, deps) and tsconfig.json for Node/CommonJS build.

Written by Cursor Bugbot for commit 6f2a23a. This will update automatically on new commits. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/puppeteerHelpers.ts
case 'wait': {
const duration = action.scrollY ?? 1000;
await page.waitForTimeout(duration);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

Comment thread src/fakeCursor.ts
document.body.appendChild(cursor);

window.__moveFakeCursor = (x, y) => {
cursor.style.transform = `translate(${x}px, ${y}px)`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant