From 52a05f994c4a944d934b50a235ee601558824c27 Mon Sep 17 00:00:00 2001 From: peptiderepo <273788462+peptiderepo@users.noreply.github.com> Date: Fri, 12 Jun 2026 16:05:30 +0700 Subject: [PATCH] Board admin smoke: assert prautoblogger-board renders for admin (#13) Guards the submenu-before-parent 404 class in the deploy gate. QA: APPROVE-W-P2 qa-reviews/peptide-e2e/2026-06-12-113bb17.md Agent-Session: cto-board-404-hotfix-merge-20260612 --- CHANGELOG.md | 21 +++++++++++++++++++ package.json | 2 +- tests/03-admin-plugins.spec.ts | 38 ++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0752d61 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to the peptide-e2e smoke suite will be documented here. + +## [1.1.0] - 2026-06-12 + +### Added +- **Board page smoke test** (`03-admin-plugins.spec.ts` — `WP Admin — PRAutoBlogger board page`). + Navigates to `/wp-admin/admin.php?page=prautoblogger-board`, asserts HTTP 200, + `#prab-board` container visible, and body does NOT contain "Invalid plugin page". + Guards against the v0.19.1 regression class: Board submenu registered before parent + menu existed (both at admin_menu priority 10) → WordPress fallback hookname → + wp_die 404. Now in the deploy-gate smoke suite so this failure class is un-shippable. + + Note: cannot be validated against prod until v0.19.1 of PRAutoBlogger deploys. + Spec compiles and lists cleanly under `npx playwright test --list`. + +## [1.0.0] - 2026-06-11 + +Initial release. 21 tests across 5 specs: homepage, reconstitution calculator, +peptide search, admin plugins, REST API. diff --git a/package.json b/package.json index 0a3e141..77a844b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peptide-e2e", - "version": "1.0.0", + "version": "1.1.0", "description": "Playwright smoke tests for peptiderepo.com (staging + production)", "private": true, "scripts": { diff --git a/tests/03-admin-plugins.spec.ts b/tests/03-admin-plugins.spec.ts index 774c246..52f9a7d 100755 --- a/tests/03-admin-plugins.spec.ts +++ b/tests/03-admin-plugins.spec.ts @@ -94,6 +94,44 @@ test.describe('WP Admin — PRAutoBlogger settings page', () => { }); }); +test.describe('WP Admin — PRAutoBlogger board page', () => { + /** + * Smoke test: Board submenu page must load without 404 or "Invalid plugin page". + * + * This test guards against the v0.19.1 regression class: Board submenu was + * registered before the parent top-level menu page existed (both at admin_menu + * priority 10), causing WordPress to fall back to the `admin_page_*` hookname. + * At request time WP recomputed the hookname, found nothing, and called + * wp_die("Invalid plugin page"). The fix (v0.19.1) moves the board hook to + * priority 11 so the parent menu slot is populated first. + * + * Selector sourced from templates/admin/board-page.php: `
`. + * + * NOTE: This test cannot be validated against prod until v0.19.1 is deployed. + * It is included in the deploy-gate smoke suite so the bug class becomes + * un-shippable in future. The spec compiles and lists cleanly; the test will + * run correctly once the fix is live. + */ + test('board page loads and board container is present', async ({ page }) => { + // Navigate to the Board submenu page. + const res = await page.goto(`${ADMIN}/admin.php?page=prautoblogger-board`); + + // Must be HTTP 200 — not wp_die 404. + expect(res?.status()).toBe(200); + + // wp-admin chrome must render (confirms we're authenticated and in admin). + await expect(page.locator('#wpbody')).toBeVisible(); + + // Body must NOT contain the wp_die "Invalid plugin page" error string. + const body = await page.textContent('body'); + expect(body).not.toContain('Invalid plugin page'); + + // Board container div must be present (from templates/admin/board-page.php). + // selector:
+ await expect(page.locator('#prab-board')).toBeVisible({ timeout: 10_000 }); + }); +}); + test.describe('WP Admin — Peptide Repo Core admin', () => { test('PR Core menu item exists in wp-admin', async ({ page }) => { await page.goto(`${ADMIN}/`);