From 6c631bdeecaa2fd753bcb88bd13c2b7a6111361c Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Sun, 9 Aug 2026 02:59:17 -0300 Subject: [PATCH] =?UTF-8?q?fix(e2e):=20agenda=20=E2=80=94=20waits=20de=20v?= =?UTF-8?q?isibilidade=20para=20medir=20o=20slot=20do=20calend=C3=A1rio=20?= =?UTF-8?q?(estabiliza=20inline/mais=20detalhes)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/campaignActivity.e2e.spec.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/e2e/campaignActivity.e2e.spec.ts b/tests/e2e/campaignActivity.e2e.spec.ts index 878914ca..b5b311a2 100644 --- a/tests/e2e/campaignActivity.e2e.spec.ts +++ b/tests/e2e/campaignActivity.e2e.spec.ts @@ -168,10 +168,14 @@ test.describe('Agenda — calendário operacional', () => { const dayCell = page.getByRole('gridcell').nth(1) await dayCell.scrollIntoViewIfNeeded() - const [slotBox, dayBox] = await Promise.all([ - page.locator('[data-time="14:00:00"]').last().boundingBox(), - dayCell.boundingBox(), - ]) + // FullCalendar renders the time axis lazily and re-lays out on mount — + // wait for both targets to be attached+visible before measuring, or the + // bounding boxes race the grid render. + const slotLocator = page.locator('[data-time="14:00:00"]:visible').last() + await expect(slotLocator).toBeVisible() + await expect(dayCell).toBeVisible() + const slotBox = await slotLocator.boundingBox() + const dayBox = await dayCell.boundingBox() if (!slotBox || !dayBox) throw new Error('A grade semanal não expôs o slot esperado.') await dayCell.click({ position: { @@ -216,10 +220,11 @@ test.describe('Agenda — calendário operacional', () => { const dayCell = page.getByRole('gridcell').nth(1) await dayCell.scrollIntoViewIfNeeded() - const [slotBox, dayBox] = await Promise.all([ - page.locator('[data-time="14:00:00"]').last().boundingBox(), - dayCell.boundingBox(), - ]) + const slotLocator = page.locator('[data-time="14:00:00"]:visible').last() + await expect(slotLocator).toBeVisible() + await expect(dayCell).toBeVisible() + const slotBox = await slotLocator.boundingBox() + const dayBox = await dayCell.boundingBox() if (!slotBox || !dayBox) throw new Error('A grade semanal não expôs o slot esperado.') await dayCell.click({ position: {