Compare commits
3 Commits
claude/set
...
claude/fix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80ad1eb0f9 | ||
|
|
a31a39c898 | ||
|
|
c131db5fef |
@@ -33,8 +33,18 @@ setup('authenticate as WP admin', async ({ page }) => {
|
||||
await page.fill('#user_pass', password);
|
||||
await page.click('#wp-submit');
|
||||
|
||||
// Wait for successful redirect to wp-admin dashboard
|
||||
await expect(page).toHaveURL(/wp-admin/, { timeout: 20_000 });
|
||||
// Wait for any post-login navigation. The site may redirect successful logins
|
||||
// to the homepage (via a login_redirect filter) rather than to wp-admin —
|
||||
// staging does this. So we don't assert the post-submit URL; instead, we
|
||||
// verify we're no longer ON wp-login.php (which would indicate a credential
|
||||
// rejection or 2FA prompt) and then navigate explicitly to wp-admin.
|
||||
await page.waitForURL((url) => !url.pathname.includes('/wp-login.php'), {
|
||||
timeout: 20_000,
|
||||
});
|
||||
|
||||
// Navigate explicitly into wp-admin to capture the authenticated admin session.
|
||||
await page.goto('/wp-admin/');
|
||||
await expect(page).toHaveURL(/\/wp-admin\//, { timeout: 20_000 });
|
||||
await expect(page.locator('#wpadminbar')).toBeVisible();
|
||||
|
||||
// Persist session cookies + localStorage to disk
|
||||
|
||||
@@ -43,9 +43,14 @@ export default defineConfig({
|
||||
},
|
||||
|
||||
projects: [
|
||||
// Auth setup — runs first, saves session to disk
|
||||
// Auth setup — runs first, saves session to disk.
|
||||
// testDir override: global.setup.ts lives at repo root, not under ./tests.
|
||||
// Without this, the top-level testDir './tests' filters it out and the
|
||||
// setup project silently runs 0 tests, leaving the storage-state file
|
||||
// unwritten and every chromium-project test failing on storageState load.
|
||||
{
|
||||
name: 'setup',
|
||||
testDir: '.',
|
||||
testMatch: /global\.setup\.ts/,
|
||||
},
|
||||
// All smoke tests — depend on auth setup
|
||||
|
||||
@@ -29,7 +29,7 @@ test.describe('Homepage', () => {
|
||||
|
||||
test('renders site name in page title', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await expect(page).toHaveTitle(/peptiderepo/i);
|
||||
await expect(page).toHaveTitle(/peptide ?repo/i);
|
||||
});
|
||||
|
||||
test('wp-admin bar present (logged-in session)', async ({ page }) => {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
const CALC_PATH = process.env.CALC_PAGE_PATH ?? '/reconstitution-calculator/';
|
||||
const CALC_PATH = process.env.CALC_PAGE_PATH ?? '/calculator/';
|
||||
|
||||
test.describe('Reconstitution Calculator', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@@ -25,7 +25,7 @@ const REQUIRED_PLUGINS = [
|
||||
'peptide-search-ai',
|
||||
'peptide-repo-core',
|
||||
'peptide-reconstitution-calculator',
|
||||
'pr-autoblogger',
|
||||
'prautoblogger',
|
||||
'peptide-starter-theme', // theme, shown differently — checked separately
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user