Commit Graph

7 Commits

Author SHA1 Message Date
Engineer PRAutoBlogger
fd2d0823d6 test(smoke): dossier page smoke guard — assert HTTP 200 + #prab-dossier + no fatal (v1.2.0)
Adds dossier smoke test to 03-admin-plugins.spec.ts (describe block:
'WP Admin — PRAutoBlogger Article Dossier').

Guards:
- Menu-ordering regression: wrong hookname -> wp_die 404 (same class as v0.19.1 board bug)
- PHP fatal on dossier load
- Missing #prab-dossier container (template regression)
- Stage-section regression (conditional on run data existing)

Defensive strategy:
- Tries canonical staging posts 925/930 via REST API first
- Falls back to most recent post via /wp-json/wp/v2/posts
- Falls back to post_id=0 (graceful empty state) with loud test.info() annotation
- Stage-section assertions conditional: if stages present they must render; if absent
  the pre-substrate graceful state is expected (no failure)

npx playwright test --list shows 24 tests (was 23).
New test at 03-admin-plugins.spec.ts:185.
TypeScript compiles without errors.

Part of PRAutoBlogger v0.19.2 M2 milestone. Companion PR: peptiderepo/prautoblogger#158.

Agent-Session: claude-sonnet-4-6
2026-06-12 10:40:49 +00:00
peptiderepo
113bb17e43 test(smoke): board page smoke guard — assert HTTP 200 + #prab-board (v1.1.0)
Add board page smoke test to 03-admin-plugins.spec.ts under the
'WP Admin — PRAutoBlogger board page' describe block.

The test navigates to /wp-admin/admin.php?page=prautoblogger-board and
asserts:
  1. HTTP 200 (not wp_die 404)
  2. #wpbody visible (authenticated admin session confirmed)
  3. body does NOT contain 'Invalid plugin page' (the wp_die string)
  4. #prab-board container visible (selector from templates/admin/board-page.php)

This guards against the v0.19.1 regression class: PRAutoBlogger_Board_Page
was registered at admin_menu priority 10, before the parent top-level menu
(also 10). WordPress computed the wrong hookname (admin_page_*) at
add_submenu_page() time; at request time it recomputed prautoblogger_page_*,
found nothing, and called wp_die() — 404. The board was un-navigable since
v0.19.0 shipped. With this test in the deploy gate, this failure class is
now un-shippable.

Spec compiles and lists cleanly (npx playwright test --list: 23 tests).
Cannot be validated against prod until v0.19.1 deploys; stated in spec comment.

Agent-Session: board-404-hotfix-20260612
2026-06-12 08:32:08 +00:00
peptiderepo
a09d210895 test(smoke): label-agnostic admin-menu check (#9)
The peptide CPT menu was restructured (no top-level 'Peptides' label), so the
text=Peptides assertion failed. Assert the CPT's admin link by href
(a[href*='post_type=peptide']) and toBeAttached — robust to label changes and
submenu (hidden-until-hover) placement.

Agent-Session: cto smoke-green

Co-authored-by: peptiderepo <peptiderepo@users.noreply.github.com>
2026-06-09 22:24:44 +07:00
peptiderepo
3ed4b10ecd test(smoke): fix remaining 6 failures (#8)
- 02 search: target the visible .hero-search instance; the old .first()
  selector matched the hidden header search-overlay (instance 1).
- 01 calculator: it auto-computes from the peptide preset; select the peptide
  and assert #prc-results, scoped to .prc-calculator (the old broad
  button[type=submit] selector clicked the PSA search button).
- 03 admin: 'const nav' had been swallowed into a comment (ReferenceError).
- 04 rest-api: PSA /search returns {results:[]} with no 'status' key; drop it.

Auth fixed separately via a dedicated staging CI admin (ci-smoke) + corrected
STAGING_WP_ADMIN_* secrets; the global.setup failure was cascading into these.

Agent-Session: cto smoke-green

Co-authored-by: peptiderepo <peptiderepo@users.noreply.github.com>
2026-06-09 22:20:39 +07:00
peptiderepo
e183e26926 test(smoke): fix three stale assertions (#3)
- 01 calculator: page lives at /calculator/ (confirmed live), not
  /reconstitution-calculator/ — the 404 failed all 3 calc tests.
- 00 homepage: brand title is 'Peptide Repo' (with space); regex /peptiderepo/i
  never matched. Broadened to /peptide ?repo/i.
- 03 admin: required-plugin slug is 'prautoblogger' (WP dir), not 'pr-autoblogger'.

These were test bugs, not site regressions — the site serves all three correctly.

Agent-Session: cto smoke-triage

Co-authored-by: peptiderepo <peptiderepo@users.noreply.github.com>
2026-06-09 13:45:06 +07:00
peptiderepo
ef7b705111 fix: complete truncated test files in 03 and 04 specs
03-admin-plugins.spec.ts and 04-rest-api.spec.ts were cut off mid-test,
causing Playwright TypeScript parse failures and the smoke gate to show
0 jobs. Added the missing test bodies, assertions, and closing braces.

New tests added:
- PR Core Settings page loads (03)
- Peptide CPT verified via /wp-json/wp/v2/types/peptide (04)

Fixes smoke gate for all future deploys.
2026-04-27 05:39:26 +00:00
peptiderepo
d46a1e4680 feat: initial Playwright smoke suite
20 tests across 5 files covering all plugin surfaces on staging:
- Homepage load and PHP fatal detection
- Reconstitution Calculator shortcode + math
- Peptide Search AI widget + AJAX response
- Admin: all plugins active, PSA + PRAutoBlogger settings pages
- REST API: prc/v1/presets, peptides/v1/search, compounds, CPT types

Staging shortcode pages:
  /reconstitution-calculator/ - [prc_calculator]
  /search-peptides/           - [peptide_search]
  /peptide-directory/         - [peptide_directory]

GHA workflow: smoke.yml supports manual dispatch + workflow_call
for use as a deploy gate from plugin repos.
2026-04-26 04:39:13 +00:00