From eb281ab5aa4d167f59dbc66a75278ef15c82cea9 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Mon, 17 Aug 2026 02:53:02 -0300 Subject: [PATCH] =?UTF-8?q?fix(e2e=20C104):=20clica=20no=20slot=2014:00=20?= =?UTF-8?q?da=20coluna=20de=20hoje,=20n=C3=A3o=20no=20centro=20da=20linha?= =?UTF-8?q?=20de=20hora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit O data-time do FullCalendar é uma linha única que atravessa a semana; o clique force no centro dela resolve o dia pela coordenada x -> coluna do meio da semana (quinta). Com o término calculado como hoje+1 (C134), o teste falhava seg/ter quando o término caía antes do início (alert de validação no overlay). Passa a clicar na coluna do dia atual. --- tests/e2e/campaignActivity.e2e.spec.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/e2e/campaignActivity.e2e.spec.ts b/tests/e2e/campaignActivity.e2e.spec.ts index 8b990048..7cb0c1b2 100644 --- a/tests/e2e/campaignActivity.e2e.spec.ts +++ b/tests/e2e/campaignActivity.e2e.spec.ts @@ -11,7 +11,10 @@ import { civilDatePlusDays, dayLabelFor, ptBrMonthNames } from './helpers/agenda * clicks the 14:00 slot. `force` bypasses the C104 all-day lane, which paints * day fills over the time grid: real clicks still land on the slot * (FullCalendar resolves by data-time), but Playwright's actionability check - * refuses them. + * refuses them. The click targets TODAY's column: the time row is a single + * element spanning the whole week, so a centered click lands on the middle + * column (Thursday), and C104's end date (today + 1) would fall before the + * start on Mondays and Tuesdays. */ const openAgendaSlot = async ({ campaign, @@ -27,7 +30,19 @@ const openAgendaSlot = async ({ const slotLocator = page.locator('[data-time="14:00:00"]:visible').last() await expect(slotLocator).toBeVisible() await slotLocator.scrollIntoViewIfNeeded() - await slotLocator.click({ force: true }) + const slotBox = await slotLocator.boundingBox() + const todayBox = await page + .locator(`[data-date="${formatBahiaCivilDate(new Date())}"]`) + .last() + .boundingBox() + if (!slotBox || !todayBox) throw new Error('agenda grid boxes unavailable') + await slotLocator.click({ + position: { + x: todayBox.x - slotBox.x + todayBox.width / 2, + y: slotBox.height / 2, + }, + force: true, + }) } test.describe('Atividades — registro-fundação', () => {