feat(e2e): admin smoke coverage for Peptide News + PR Vision (v1.7.0) #20

Merged
peptiderepo merged 5 commits from claude/e2e-news-vision-admin-20260617 into main 2026-06-16 18:41:11 +00:00
peptiderepo commented 2026-06-16 18:31:42 +00:00 (Migrated from github.com)

What changed

Adds two new Playwright smoke spec files extending admin coverage to the two previously uncovered plugins:

  • tests/07-peptide-news-admin.spec.ts — Peptide News Plugin (4 pages, 5 tests)
  • tests/08-pr-vision-admin.spec.ts — PR Vision plugin (4 pages, 6 tests)

Also bumps version 1.5.0 → 1.7.0 and adds CHANGELOG entry.


Spec 07 — Peptide News Plugin admin

Menu slugs (from admin/class-pn-admin-menu.php):

  • peptide-news-dashboard, peptide-news-settings, peptide-news-articles, peptide-news-costs

Tests:

  1. Dashboard loads HTTP 200, no PHP fatal
  2. Dashboard renders h1 "Peptide News Analytics", .pn-summary-cards, .pn-date-filter
  3. Settings page loads, settings <form> present
  4. Articles page loads without fatal
  5. LLM Costs page loads without fatal

Skip-if-absent: isPluginAbsent() helper checks for "Invalid plugin page", "do not have sufficient permissions", or URL redirect stripping page=. All tests skip loudly instead of hard-failing when plugin not installed.


Spec 08 — PR Vision admin

Menu slugs (from class-prv-admin-page.php, class-prv-settings-page.php, class-prv-costs-page.php, class-prv-call-log-page.php):

  • pr-vision, pr-vision-settings, pr-vision-costs, pr-vision-calls

Tests:

  1. Dashboard loads HTTP 200, no fatal, h1 "PR Vision" visible
  2. Settings page loads HTTP 200, no fatal
  3. API-key-manager card (#prv-key-card) present, status badge (#prv-key-source-badge) visible
  4. Write-only invariant: #prv_api_key renders with value="" (stored key never output); full page HTML must not contain "sk-or-" (OpenRouter key prefix)
  5. Costs page loads without fatal
  6. Call Log page loads without fatal

Skip-if-absent at two levels:

  • Plugin absent → all tests skip with loud annotation
  • #prv-key-card absent (Settings v0.2.0 not yet deployed) → targeted skip on key-manager tests only

Selectors sourced from source code:

  • class-prv-admin-page.php — h1 heading
  • class-prv-key-manager-renderer.php — #prv-key-card, #prv-key-source-badge, #prv_api_key

Risk flags

  • Read-only specs: no mutations, no form submits, no side effects
  • No LLM calls triggered
  • workers: 1 compatibility maintained
  • Write-only invariant check: page.content() assertion on "sk-or-" absence guards key leakage regression

Test plan

CI lint-js (node --check / npx tsc --noEmit) validates TypeScript on PR. Functional run gates on next staging deploy of both plugins (both live on staging since 2026-06-13/14).

## What changed Adds two new Playwright smoke spec files extending admin coverage to the two previously uncovered plugins: - `tests/07-peptide-news-admin.spec.ts` — Peptide News Plugin (4 pages, 5 tests) - `tests/08-pr-vision-admin.spec.ts` — PR Vision plugin (4 pages, 6 tests) Also bumps version 1.5.0 → 1.7.0 and adds CHANGELOG entry. --- ## Spec 07 — Peptide News Plugin admin **Menu slugs** (from `admin/class-pn-admin-menu.php`): - `peptide-news-dashboard`, `peptide-news-settings`, `peptide-news-articles`, `peptide-news-costs` **Tests:** 1. Dashboard loads HTTP 200, no PHP fatal 2. Dashboard renders h1 "Peptide News Analytics", `.pn-summary-cards`, `.pn-date-filter` 3. Settings page loads, settings `<form>` present 4. Articles page loads without fatal 5. LLM Costs page loads without fatal **Skip-if-absent:** `isPluginAbsent()` helper checks for "Invalid plugin page", "do not have sufficient permissions", or URL redirect stripping `page=`. All tests skip loudly instead of hard-failing when plugin not installed. --- ## Spec 08 — PR Vision admin **Menu slugs** (from `class-prv-admin-page.php`, `class-prv-settings-page.php`, `class-prv-costs-page.php`, `class-prv-call-log-page.php`): - `pr-vision`, `pr-vision-settings`, `pr-vision-costs`, `pr-vision-calls` **Tests:** 1. Dashboard loads HTTP 200, no fatal, h1 "PR Vision" visible 2. Settings page loads HTTP 200, no fatal 3. API-key-manager card (`#prv-key-card`) present, status badge (`#prv-key-source-badge`) visible 4. **Write-only invariant:** `#prv_api_key` renders with `value=""` (stored key never output); full page HTML must not contain `"sk-or-"` (OpenRouter key prefix) 5. Costs page loads without fatal 6. Call Log page loads without fatal **Skip-if-absent at two levels:** - Plugin absent → all tests skip with loud annotation - `#prv-key-card` absent (Settings v0.2.0 not yet deployed) → targeted skip on key-manager tests only **Selectors sourced from source code:** - `class-prv-admin-page.php` — h1 heading - `class-prv-key-manager-renderer.php` — `#prv-key-card`, `#prv-key-source-badge`, `#prv_api_key` --- ## Risk flags - Read-only specs: no mutations, no form submits, no side effects - No LLM calls triggered - `workers: 1` compatibility maintained - Write-only invariant check: `page.content()` assertion on `"sk-or-"` absence guards key leakage regression ## Test plan CI lint-js (`node --check` / `npx tsc --noEmit`) validates TypeScript on PR. Functional run gates on next staging deploy of both plugins (both live on staging since 2026-06-13/14).
Sign in to join this conversation.