Fix global.setup.ts: tolerate post-login redirect away from wp-admin #2

Merged
peptiderepo merged 1 commits from claude/setup-post-login-redirect-fix-20260514 into main 2026-05-14 12:30:30 +00:00
peptiderepo commented 2026-05-14 12:28:50 +00:00 (Migrated from github.com)

Summary

  • The previous setup asserted the post-login URL matches /wp-admin/. On staging.peptiderepo.com, a login_redirect filter sends successful admin logins to the site homepage instead of wp-admin - so the assertion failed even on correct credentials. The login was actually succeeding (wordpress_logged_in_* cookie set, verified via direct curl probe) but Playwright treated the test as failed because the URL pattern didn't match.
  • Replaces post-submit URL match with two safer checks:
    • Wait until URL is no longer wp-login.php (i.e. login was accepted)
    • Navigate explicitly to /wp-admin/ and assert we land there with #wpadminbar visible

Context

This is the third bug in the smoke-gate chain. The first two were:

  1. peptide-e2e#1 - testDir misalignment hiding global.setup.ts from discovery
  2. Stale staging admin GH Secrets (rotated 2026-05-14 across all 6 plugin repos) - was peptiderepo, should have been admin@peptiderepo.com

With those fixed, the post-login-redirect bug surfaced.

Test plan

  • Merge to main

  • Re-run failed Deploy PRAutoBlogger to Hostinger job on prautoblogger SHA 1955f928

  • Confirm setup project passes (not in the failure set anymore)

  • Confirm smoke gate passes and Deploy to Production promotes

  • CTO

## Summary - The previous setup asserted the post-login URL matches `/wp-admin/`. On staging.peptiderepo.com, a `login_redirect` filter sends successful admin logins to the site homepage instead of wp-admin - so the assertion failed even on correct credentials. The login was actually succeeding (`wordpress_logged_in_*` cookie set, verified via direct curl probe) but Playwright treated the test as failed because the URL pattern didn't match. - Replaces post-submit URL match with two safer checks: - Wait until URL is no longer `wp-login.php` (i.e. login was accepted) - Navigate explicitly to `/wp-admin/` and assert we land there with `#wpadminbar` visible ## Context This is the third bug in the smoke-gate chain. The first two were: 1. [peptide-e2e#1](https://github.com/peptiderepo/peptide-e2e/pull/1) - testDir misalignment hiding global.setup.ts from discovery 2. Stale staging admin GH Secrets (rotated 2026-05-14 across all 6 plugin repos) - was `peptiderepo`, should have been `admin@peptiderepo.com` With those fixed, the post-login-redirect bug surfaced. ## Test plan - [ ] Merge to main - [ ] Re-run failed `Deploy PRAutoBlogger to Hostinger` job on prautoblogger SHA `1955f928` - [ ] Confirm setup project passes (not in the failure set anymore) - [ ] Confirm smoke gate passes and Deploy to Production promotes - CTO
Sign in to join this conversation.