Live verification against a real Reddit login page (from this dev sandbox) showed: - The actual submit button has no [type="submit"] attribute; its accessible name is "Log In" — switched to getByRole with that name. - Username/password fields are better targeted via their visible labels (getByLabel) than brittle name= attribute selectors. - A cookie-consent dialog can overlay the form and intercept clicks; it's now dismissed via "Reject Optional Cookies" before filling in. - This sandbox's network is flagged by Reddit's bot detection with a "blocked by network security" interstitial before the login form even loads — this is unrelated to credentials and unrelated to the target account (confirmed reachable fine from a residential network/browser). Added explicit detection for this state so it reports a clear, distinguishable error instead of a generic CAPTCHA/2FA guess. Full live end-to-end verification (successful login + post creation) must be run from a network Reddit does not block, e.g. the mini PC this app actually runs on. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reddit Post Sidecar
A Playwright acceptance test that logs into Reddit with supplied credentials and creates a text post in a given subreddit.
One-time setup
cd sidecars/reddit-post
npm install
npx playwright install chromium
Usage
./run.sh --username=YOUR_USERNAME --password=YOUR_PASSWORD \
--subreddit=test --title="Hello" --body="Post body text" [--headed]
Prints a single JSON line to stdout and exits 0 on success, exits 1 on failure:
{"success": true, "url": "https://www.reddit.com/r/test/comments/.../"}
{"success": false, "error": "Login did not complete — possible CAPTCHA or 2FA prompt"}