fix(e2e): guard-first ordering in specs 07+08 — skip before Invalid-plugin-page assert

In 07-peptide-news-admin (Articles + LLM Costs) and 08-pr-vision-admin
(Costs + Call Log), the hard expect(body).not.toContain('Invalid plugin page')
assertion fired BEFORE the isPluginAbsent() skip guard. If either plugin is
absent from staging, those tests would hard-fail — gating prod for all apps.

Fix: move isPluginAbsent() + test.skip() above the Invalid-plugin-page assert
in all four affected tests, mirroring the Dashboard/Settings guard-first pattern
already used in the same files.

- 07 Articles: skip guard now before Invalid plugin page check
- 07 LLM Costs: skip guard now before Invalid plugin page check
- 08 Costs: skip guard now before Invalid plugin page check
- 08 Call Log: skip guard now before Invalid plugin page check

Validated: npx playwright test --list lists all 38 tests cleanly.

Agent-Session: engineer-infra-e2e-guardfix-20260617
This commit is contained in:
peptiderepo
2026-06-16 18:40:01 +00:00
parent 7794ecb11e
commit 8596b5dfa1
2 changed files with 8 additions and 4 deletions

View File

@@ -121,9 +121,10 @@ test.describe('WP Admin - Peptide News Plugin articles page', () => {
await expect(page.locator('#wpbody')).toBeVisible();
const body = (await page.textContent('body')) ?? '';
expect(body).not.toContain('Fatal error');
expect(body).not.toContain('Invalid plugin page');
if (isPluginAbsent(body, page.url())) { skipMissing(); return; }
expect(body).not.toContain('Invalid plugin page');
});
});
@@ -135,8 +136,9 @@ test.describe('WP Admin - Peptide News Plugin LLM costs page', () => {
await expect(page.locator('#wpbody')).toBeVisible();
const body = (await page.textContent('body')) ?? '';
expect(body).not.toContain('Fatal error');
expect(body).not.toContain('Invalid plugin page');
if (isPluginAbsent(body, page.url())) { skipMissing(); return; }
expect(body).not.toContain('Invalid plugin page');
});
});

View File

@@ -185,9 +185,10 @@ test.describe('WP Admin - PR Vision Costs page', () => {
await expect(page.locator('#wpbody')).toBeVisible();
const body = (await page.textContent('body')) ?? '';
expect(body).not.toContain('Fatal error');
expect(body).not.toContain('Invalid plugin page');
if (isPluginAbsent(body, page.url())) { skipMissing(); return; }
expect(body).not.toContain('Invalid plugin page');
});
});
@@ -199,8 +200,9 @@ test.describe('WP Admin - PR Vision Call Log page', () => {
await expect(page.locator('#wpbody')).toBeVisible();
const body = (await page.textContent('body')) ?? '';
expect(body).not.toContain('Fatal error');
expect(body).not.toContain('Invalid plugin page');
if (isPluginAbsent(body, page.url())) { skipMissing(); return; }
expect(body).not.toContain('Invalid plugin page');
});
});