fix(e2e C104): clica no slot 14:00 da coluna de hoje, não no centro da linha de hora
Some checks failed
Agent PR Ready + auto-merge / ready-automerge (pull_request) Has been skipped
CI (PR) / docs-guards (pull_request) Successful in 7s
CI (PR) / plans-only-closes (pull_request) Successful in 7s
CI (PR) / scope (pull_request) Successful in 43s
CI (PR) / lint (pull_request) Successful in 54s
CI (PR) / typecheck (pull_request) Successful in 30s
CI (PR) / knip (pull_request) Successful in 31s
CI (PR) / cycles (pull_request) Successful in 30s
CI (PR) / unit (pull_request) Successful in 44s
CI (PR) / format (pull_request) Failing after 2m6s
CI (PR) / int (pull_request) Has been skipped
CI (PR) / build (pull_request) Has been skipped
CI (PR) / e2e (pull_request) Has been skipped
CI (PR) / checks (pull_request) Failing after 1s
Some checks failed
Agent PR Ready + auto-merge / ready-automerge (pull_request) Has been skipped
CI (PR) / docs-guards (pull_request) Successful in 7s
CI (PR) / plans-only-closes (pull_request) Successful in 7s
CI (PR) / scope (pull_request) Successful in 43s
CI (PR) / lint (pull_request) Successful in 54s
CI (PR) / typecheck (pull_request) Successful in 30s
CI (PR) / knip (pull_request) Successful in 31s
CI (PR) / cycles (pull_request) Successful in 30s
CI (PR) / unit (pull_request) Successful in 44s
CI (PR) / format (pull_request) Failing after 2m6s
CI (PR) / int (pull_request) Has been skipped
CI (PR) / build (pull_request) Has been skipped
CI (PR) / e2e (pull_request) Has been skipped
CI (PR) / checks (pull_request) Failing after 1s
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.
This commit is contained in:
parent
2f538e396b
commit
eb281ab5aa
1 changed files with 17 additions and 2 deletions
|
|
@ -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
|
* 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
|
* day fills over the time grid: real clicks still land on the slot
|
||||||
* (FullCalendar resolves by data-time), but Playwright's actionability check
|
* (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 ({
|
const openAgendaSlot = async ({
|
||||||
campaign,
|
campaign,
|
||||||
|
|
@ -27,7 +30,19 @@ const openAgendaSlot = async ({
|
||||||
const slotLocator = page.locator('[data-time="14:00:00"]:visible').last()
|
const slotLocator = page.locator('[data-time="14:00:00"]:visible').last()
|
||||||
await expect(slotLocator).toBeVisible()
|
await expect(slotLocator).toBeVisible()
|
||||||
await slotLocator.scrollIntoViewIfNeeded()
|
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', () => {
|
test.describe('Atividades — registro-fundação', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue