From 8596b5dfa19f2ec7dcba0bac06a569f7caca9304 Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Tue, 16 Jun 2026 18:40:01 +0000 Subject: [PATCH] =?UTF-8?q?fix(e2e):=20guard-first=20ordering=20in=20specs?= =?UTF-8?q?=2007+08=20=E2=80=94=20skip=20before=20Invalid-plugin-page=20as?= =?UTF-8?q?sert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/07-peptide-news-admin.spec.ts | 6 ++++-- tests/08-pr-vision-admin.spec.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/07-peptide-news-admin.spec.ts b/tests/07-peptide-news-admin.spec.ts index 500cdf7..612cbe6 100644 --- a/tests/07-peptide-news-admin.spec.ts +++ b/tests/07-peptide-news-admin.spec.ts @@ -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'); }); }); diff --git a/tests/08-pr-vision-admin.spec.ts b/tests/08-pr-vision-admin.spec.ts index 1719ac9..223bcb8 100644 --- a/tests/08-pr-vision-admin.spec.ts +++ b/tests/08-pr-vision-admin.spec.ts @@ -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'); }); });