Some checks failed
CD / Build and push images (push) Failing after 5s
CD / Deploy to Test (push) Has been skipped
CD / Smoke tests against Test (push) Has been skipped
CD / Promote to Int (push) Has been skipped
CI / Lint, typecheck, test (push) Failing after 7s
CI / Build container images (push) Has been skipped
On every push to main: build both images once (SHA + moving `test` tag), push to the Gitea registry, SSH-deploy the Test stage, wait for readiness, run the new Playwright smoke suite (SPA shell, web liveness, api healthz/readyz) against https://test.dorfteich.cloud, and on green retag the identical SHA images as `int` and deploy Int. The CI image-build job becomes PR-only to avoid double builds on main. Part of #8 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
26 lines
944 B
TypeScript
26 lines
944 B
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
// Walking-skeleton smoke suite: proves the deployed stage serves the SPA,
|
|
// the reverse proxy routes /api, and the api is ready (db + migrations).
|
|
// Feature e2e packs (issues #20, #32, …) build on this file's patterns.
|
|
|
|
test('SPA shell loads', async ({ page }) => {
|
|
await page.goto('/');
|
|
await expect(page).toHaveTitle(/Dorfteich/);
|
|
await expect(page.getByRole('heading', { level: 1 })).toBeVisible();
|
|
});
|
|
|
|
test('web liveness endpoint responds', async ({ request }) => {
|
|
const res = await request.get('/healthz');
|
|
expect(res.ok()).toBeTruthy();
|
|
});
|
|
|
|
test('api is live and ready', async ({ request }) => {
|
|
const healthz = await request.get('/api/v1/healthz');
|
|
expect(healthz.ok()).toBeTruthy();
|
|
expect((await healthz.json()).status).toBe('ok');
|
|
|
|
const readyz = await request.get('/api/v1/readyz');
|
|
expect(readyz.ok(), `readyz: ${await readyz.text()}`).toBeTruthy();
|
|
});
|