review fixes: seeded-auth hard gate, ci.yml build serialization, assets 404
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
- M1: E2E_REQUIRE_SEEDED_AUTH=1 in the CI e2e step makes login failures hard failures (loginAs throws, guards disabled, globalSetup refuses a pre-populated DB); auth.spec redirect test asserts outright under the flag; non-admin /admin test is now a real authorization assertion - M2: ci.yml build step depends_on test — never two concurrent turbo builds on the shared workspace - M3: unknown /assets/* paths 404 from the SPA catch-all instead of serving index.html with an immutable cache header; spec arm added - minors: e2e step gets when: *image_build_when, health poll uses GATEWAY_PORT + AbortSignal.timeout, BETTER_AUTH_SECRET generated per run (no literal in tree), failure echoes artifact path, dev-guide documents the gate, stale verify-release comment fixed
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { TEST_USER } from './helpers/auth.js';
|
||||
import { REQUIRE_SEEDED_AUTH, TEST_USER } from './helpers/auth.js';
|
||||
|
||||
// ── Login page ────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -49,18 +49,14 @@ test.describe('Login page', () => {
|
||||
});
|
||||
|
||||
test('redirects to /chat after successful login', async ({ page }) => {
|
||||
// Only meaningful with known-good credentials; against a live environment
|
||||
// this would just probe someone else's user table.
|
||||
test.skip(!REQUIRE_SEEDED_AUTH, 'needs seeded credentials (E2E_REQUIRE_SEEDED_AUTH=1)');
|
||||
await page.goto('/login');
|
||||
await page.getByLabel('Email').fill(TEST_USER.email);
|
||||
await page.getByLabel('Password').fill(TEST_USER.password);
|
||||
await page.getByRole('button', { name: /sign in/i }).click();
|
||||
// Either reaches /chat or shows an error (if credentials are wrong in this env).
|
||||
// We assert a navigation away from /login, or the alert is shown.
|
||||
await Promise.race([
|
||||
expect(page).toHaveURL(/\/chat/, { timeout: 10_000 }),
|
||||
expect(page.getByRole('alert')).toBeVisible({ timeout: 10_000 }),
|
||||
]).catch(() => {
|
||||
// Acceptable — environment may not have seeded credentials
|
||||
});
|
||||
await expect(page).toHaveURL(/\/chat/, { timeout: 10_000 });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user