Follow the new order and review screens in development browser checks

This commit is contained in:
2026-11-17 22:52:08 +01:00
parent 60f964e0d7
commit b683d6bfb5
8 changed files with 138 additions and 87 deletions
+21 -12
View File
@@ -20,21 +20,30 @@ test('dev/test browser simulation: login → fixed plan → pending → explicit
await expect(page.getByRole('status')).toContainText('kein menschlicher Produktions-Freigabenachweis');
await page.getByRole('checkbox', { name: `Ziel ${asset}`, exact: true }).check();
await page.getByRole('link', { name: 'Aufträge', exact: true }).click();
await page.getByRole('link', { name: 'Auftrag planen', exact: true }).click();
await page.getByLabel('Exakte UTF-8 Skriptbytes', { exact: false }).fill("printf '%s\\n' 'Hello World'\n");
await page.getByLabel('Erwartete stdout-Ausgabe', { exact: false }).fill('Hello World\n');
await page.getByRole('link', { name: 'Neuer Auftrag', exact: true }).click();
await page.getByRole('button', { name: 'Weiter zum Skript' }).click();
await page.getByRole('radio', { name: 'Einmaliges Skript' }).check();
await page.getByLabel('Skriptinhalt', { exact: true }).fill("printf '%s\\n' 'Hello World'\n");
await page.getByText('Zeitfenster und Ausführungsoptionen', { exact: true }).click();
await page.getByLabel('Laufzeit je Gerät in Sekunden').fill('60');
await page.getByLabel('Erwartete Standardausgabe (optional)', { exact: true }).fill('Hello World\n');
await page.getByLabel('Begründung', { exact: true }).fill('Dev/test browser simulation · Hello World');
await page.getByRole('button', { name: 'Plan erstellen · noch keine Ausführung' }).click();
const approve = page.getByRole('button', { name: 'SIMULIERT: Diesen festen Plan ausdrücklich genehmigen' });
await page.getByRole('button', { name: 'Zusammenfassung ansehen' }).click();
const approve = page.getByRole('button', { name: 'SIMULIERT: Genehmigen' });
await expect(approve).toHaveCount(0);
await page.getByRole('button', { name: 'Zur Genehmigung einreichen' }).click();
const op = page.locator('section[data-operation-id]');
await expect(op.locator('.state-pending_approval')).toBeVisible();
await op.getByRole('button', { name: 'Antrag prüfen', exact: true }).click();
await expect(approve).toBeDisabled();
await page.getByRole('button', { name: 'Antrag absenden · pending_approval' }).click();
await expect(page.getByText('Antrag: pending_approval', { exact: false })).toBeVisible();
await page.getByRole('checkbox', { name: 'Ich habe sämtliche festen Ziele', exact: false }).check();
await page.getByRole('checkbox', { name: 'Ich habe die Geräte, den Inhalt und die Ausführungsrechte geprüft.', exact: false }).check();
await expect(approve).toBeEnabled();
await approve.click(); // The only approval path: visible, interactive UI action.
await expect(page.getByText('Antrag: approved', { exact: false })).toBeVisible();
await expect(page.getByText('Ausführung: succeeded', { exact: false })).toBeVisible({ timeout: 90000 });
await page.getByRole('button', { name: /^Job / }).first().click();
await expect(page.getByRole('heading', { name: /^Job / })).toBeVisible();
await op.getByText('Technische Auftragsdaten', { exact: true }).click();
const data = op.getByLabel('Technische Auftragsdaten', { exact: true });
await expect(data).toContainText('"approval_state": "approved"');
await expect(data).toContainText('"execution_state": "succeeded"', { timeout: 90000 });
await op.locator('button[data-job-id]').first().click();
await expect(page.getByRole('heading', { name: /^Ergebnis für / })).toBeVisible();
await page.getByRole('button', { name: 'Abmelden', exact: true }).click();
});