diff --git a/e2e/tests/pizza-day.spec.ts b/e2e/tests/pizza-day.spec.ts index 38cdbc2..9325048 100644 --- a/e2e/tests/pizza-day.spec.ts +++ b/e2e/tests/pizza-day.spec.ts @@ -28,6 +28,9 @@ test.describe.serial('pizza day životní cyklus', () => { await page.locator('select').selectOption({ label: 'Pizza day' }); await page.waitForLoadState('networkidle'); + // Přijmeme všechny window.confirm() dialogy v celém testu (vytvoření i doručení pizza dne) + page.on('dialog', dialog => dialog.accept()); + // --- CREATED --- const createBtn = page.locator('.pizza-section button', { hasText: 'Založit Pizza day' }); await expect(createBtn).toBeVisible({ timeout: 10_000 }); @@ -72,8 +75,6 @@ test.describe.serial('pizza day životní cyklus', () => { // --- DELIVERED --- const deliverBtn = page.locator('.pizza-section button', { hasText: 'Doručeno' }); await expect(deliverBtn).toBeVisible({ timeout: 5_000 }); - // window.confirm dialog − Playwright automaticky potvrdí - page.on('dialog', dialog => dialog.accept()); await deliverBtn.click(); await page.waitForLoadState('networkidle'); await expect(page.locator('.pizza-section')).toContainText('doručeny', { timeout: 5_000 });