Files
ITWorx-Pulse-Public/apps/web/tests/e2e/release-backup-real.spec.ts
ITWorx Pulse release export bd774932d5
Public source validation / validate (push) Failing after 3m8s
Publish ITWorx Pulse source
2026-09-03 02:09:19 +02:00

34 lines
1.7 KiB
TypeScript

import { expect, test } from '@playwright/test';
import path from 'node:path';
test('release metadata and verified backup are production truthful', async ({ page }, testInfo) => {
test.skip(!process.env.PULSE_E2E_REAL_BASE_URL, 'Requires the isolated server-built Pulse stack.');
expect((await page.request.get('/auth/test-login')).ok()).toBeTruthy();
const created = await page.request.post('/api/v1/system/backups');
expect(created.ok()).toBeTruthy();
const response = await page.request.get('/api/v1/system/status');
expect(response.ok()).toBeTruthy();
const status = await response.json() as {
version: string;
release: { version: string; commit: string; builtAt?: string; migrationVersion: string };
backup: { state: string; reason: string; verifiedAt?: string; ageSeconds?: number };
};
expect(status.version).not.toBe('development');
expect(status.release).toMatchObject({ version: 'm11.11-test', commit: 'm1111testcommit' });
expect(status.release.builtAt).toBe('2026-08-12T03:00:00Z');
expect(status.release.migrationVersion).toMatch(/^\d{4}_.+/);
expect(status.backup).toMatchObject({ state: 'healthy', reason: 'backup_verified' });
expect(status.backup.verifiedAt).toBeTruthy();
expect(status.backup.ageSeconds).toBeGreaterThanOrEqual(0);
await page.goto('/status');
await expect(page.getByText(/m11\.11-test/)).toBeVisible();
await expect(page.getByText(/De backup is geverifieerd/)).toBeVisible();
expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1)).toBe(true);
if (process.env.PULSE_CAPTURE_VISUALS) await page.screenshot({
path: path.resolve('../../artifacts/evidence/M11-11', `release-backup-${testInfo.project.name}.png`),
fullPage: true,
});
});