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
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { loginAs, REQUIRE_SEEDED_AUTH, TEST_USER } from './helpers/auth.js';
|
|
|
|
test.describe('Projects page', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await loginAs(page, TEST_USER.email, TEST_USER.password);
|
|
const url = page.url();
|
|
test.skip(
|
|
!REQUIRE_SEEDED_AUTH && !url.includes('/chat'),
|
|
'No seeded test user — skipping authenticated tests',
|
|
);
|
|
});
|
|
|
|
test('projects page loads with heading', async ({ page }) => {
|
|
await page.goto('/projects');
|
|
// level: 1 — the "No projects yet" empty-state h2 also matches /projects/i
|
|
// and a two-element match is a strict-mode violation.
|
|
await expect(page.getByRole('heading', { level: 1, name: /projects/i })).toBeVisible({
|
|
timeout: 10_000,
|
|
});
|
|
});
|
|
|
|
test('shows empty state or project cards when loaded', async ({ page }) => {
|
|
await page.goto('/projects');
|
|
// Wait for loading state to clear
|
|
await expect(page.getByText(/loading projects/i)).not.toBeVisible({ timeout: 10_000 });
|
|
|
|
const cardsOrEmpty = page
|
|
.locator('[class*="grid"]')
|
|
.or(page.getByText(/no projects yet/i))
|
|
.first();
|
|
await expect(cardsOrEmpty).toBeVisible({ timeout: 10_000 });
|
|
});
|
|
|
|
test('sidebar navigation is present', async ({ page }) => {
|
|
await page.goto('/projects');
|
|
await expect(page.getByRole('link', { name: /projects/i }).first()).toBeVisible();
|
|
});
|
|
});
|