Skip to content

test(e2e): browser smoke test of the login captcha - #231

Merged
Upellift99 merged 2 commits into
mainfrom
test/e2e-login-captcha
Oct 23, 2026
Merged

Upellift99 merged 2 commits into
mainfrom
test/e2e-login-captcha

Conversation

@Upellift99

Copy link
Copy Markdown
Owner

Summary

altcha 3.4.0 rejected every challenge GateCHA serves and shipped in v0.9.2–v0.9.4 with a green CI, because the unit tests mock the widget. This adds a real-browser test of exactly that path.

  • web/e2e/login-captcha.e2e.ts (Playwright 1.64.0, Chromium): enables the login captcha through the admin API, opens /login, clicks "I'm not a robot", waits for Verified, signs in and expects the Dashboard.
  • web/playwright.config.ts, npm run test:e2e; files are *.e2e.ts so Vitest ignores them, and they are type-checked through tsconfig.node.json.
  • New e2e CI job: builds the frontend and the binary, starts GateCHA, installs Chromium, runs the test; on failure prints the server log and uploads the Playwright report + trace.

Verification (local)

widget result
altcha 3.4.1 (#229) ✅ 1 passed (3.0 s)
altcha 3.4.0 (v0.9.2–v0.9.4) ❌ Expected "Verified", received "… Verification failed. Try again later."

npm test (188) and npm run build (incl. type check of the e2e files) pass.

Stacked on #229 (base fix/altcha-3.4.1) so its CI runs on a fixed widget; GitHub retargets it to main when #229 merges.

🤖 Generated with Claude Code

Upellift99 and others added 2 commits October 23, 2026 23:24
Since v0.9.2 the dashboard login captcha always fails with "Verification
failed. Try again later." (console: "Challenge validation failed.").
Dependabot moved the bundled widget from altcha 3.2.4 to 3.4.0, whose
isChallengeV1 reads

    typeof !!challenge && challenge === "object" && ...

so it compares the challenge object to the string "object" and never
recognises a v1 challenge, which is what GateCHA serves. 3.4.1 fixes the
check (`challenge !== null && typeof challenge === "object"`); 3.3.0 and
3.2.4 never had the bug.

Reproduced against the published v0.9.4 image and fixed on a binary built
from this branch: the widget reaches "Verified" and a full captcha login
lands on the dashboard. npm test (188) and npm run build pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
altcha 3.4.0 rejected every challenge GateCHA serves and shipped in
v0.9.2-v0.9.4 with a green CI, because the unit tests mock the widget.
This test runs the real thing: a Playwright Chromium against a built
GateCHA binary, login captcha switched on through the admin API, clicks
"I'm not a robot", waits for "Verified", signs in and lands on the
dashboard.

Checked both ways locally: passes with altcha 3.4.1, fails with 3.4.0
on "Verification failed. Try again later." (the production symptom).

- web/e2e/login-captcha.e2e.ts, web/playwright.config.ts, npm run test:e2e
  (*.e2e.ts so Vitest does not pick it up; type-checked via
  tsconfig.node.json).
- New `e2e` CI job: builds frontend + binary, starts it, installs
  Chromium, runs the test; uploads the Playwright report and prints the
  server log on failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1263ac9a-9ab9-45ad-b720-721399c7802b
📥 Commits

Reviewing files that changed from the base of the PR and between e7503c7 and dc0c978.

⛔ Files ignored due to path filters: 1
  • web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing: 7
  • .github/workflows/test.yml
  • .gitignore
  • CLAUDE.md
  • web/e2e/login-captcha.e2e.ts
  • web/package.json
  • web/playwright.config.ts
  • web/tsconfig.node.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Upellift99
Upellift99 changed the base branch from fix/altcha-3.4.1 to main October 23, 2026 21:40
@Upellift99 Upellift99 closed this Oct 23, 2026
@Upellift99 Upellift99 reopened this Oct 23, 2026
@Upellift99
Upellift99 merged commit de748ce into main Oct 23, 2026
13 checks passed
@Upellift99
Upellift99 deleted the test/e2e-login-captcha branch October 23, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant