Session Closeout: FB Marketplace E2E Test + CDP Learnings (2026-04-25)

# FB Marketplace E2E Test + CDP Learnings

**Date:** 2026-04-25
**Repos:** browser-agent, fb-marketplace-poster, knowledgeBase

## Summary
Ran end-to-end test of fb-marketplace-poster against live FB Marketplace form. All 5 form fields (title, price, category, condition, description) fill correctly in draft mode.

## Key Discovery: CDP Mouse Events vs element.click()
CDP `Input.dispatchMouseEvent` (used by `cdp-click`) does NOT trigger Facebook React event handlers on combobox elements. The mouse events fire but React synthetic event delegation ignores them.

**Solution:** Use `element.click()` via `cdpEval` (CDP `Runtime.evaluate`) instead. This triggers the native click path that React intercepts correctly.

This affects: category dialog picker, condition dropdown, and likely all FB form controls that use React event delegation on comboboxes.

## Other Fixes
1. Content script `ensure` returns stale tab IDs after Chrome tab is closed. Replaced with extension `openTab` via `extCommand()` helper.
2. FB condition dropdown now uses title case (“Used – Good” not “Used – good”). Updated CONDITION_MAP.
3. Content script `wait-text` times out on FB due to timer throttling. Replaced with cdpEval polling.

## Commits
– fb-marketplace-poster: ea40d11 (e2e fixes), cf6c7d5 (docs)
– browser-agent: 59a9da0 (CLAUDE.md CDP gotcha)
– knowledgeBase: aab984c (wiki update)

Leave a Reply

Your email address will not be published. Required fields are marked *