Show script results directly on order details

This commit is contained in:
2026-11-17 23:15:34 +01:00
parent b683d6bfb5
commit 62f13beef2
9 changed files with 120 additions and 23 deletions
+5 -3
View File
@@ -32,12 +32,14 @@ function privateJson(file) {
await page.getByLabel('Kunde', { exact: true }).selectOption(expected.tenant_id);
assert.equal(await page.getByLabel('Kunde', { exact: true }).inputValue(), expected.tenant_id);
await page.getByRole('link', { name: 'Aufträge', exact: true }).click();
const response = page.waitForResponse(r => new URL(r.url()).pathname === `/api/v1/tenants/${expected.tenant_id}/jobs/${expected.job_id}` && r.status() === 200);
await page.locator('tr[data-operation-id="' + expected.operation_id + '"]').getByRole('button').click();
const op = page.locator('section[data-operation-id="' + expected.operation_id + '"]');
const response = page.waitForResponse(r => new URL(r.url()).pathname === `/api/v1/tenants/${expected.tenant_id}/jobs/${expected.job_id}` && r.status() === 200);
await op.locator('button[data-job-id="' + expected.job_id + '"]').click();
const detail = op.locator('article[data-job-id="' + expected.job_id + '"]');
const showResult = op.locator('button[data-job-id="' + expected.job_id + '"]');
await detail.or(showResult).first().waitFor();
if (await showResult.isVisible()) await showResult.click();
const http = await (await response).json();
const detail = page.locator('article[data-job-id="' + expected.job_id + '"]');
const rendered = await readTechnicalData(detail, 'Technische Ausführungsdaten');
assert.equal(http.state, 'succeeded'); assert.deepEqual(http, expected.result); assert.deepEqual(rendered, expected.result);