test(e2e): assert visible campaign page chrome on desktop viewport

This commit is contained in:
Cursor Agent 2026-08-02 18:55:16 +00:00
parent 39f69e603b
commit 3d13972e48
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View file

@ -299,7 +299,7 @@ test.describe('Municípios — jornadas por papel', () => {
// `password` variable above does NOT unlock the leader account.
await campaign.login(page, leaderPhone, leaderAccount.password)
await page.goto(`${campaign.baseURL}/campanha/contatos`)
await expect(page.getByText('Cadastre apoiadores pelo celular.')).toBeVisible()
await expect(campaignPageChrome(page, 'Contatos')).toBeVisible()
// The leader redirect aborts `goto`'s load event (ERR_ABORTED); the
// redirect itself is the assertion, and `toHaveURL` retries onto it.

View file

@ -562,6 +562,9 @@ export const test = base.extend<CampaignE2ETestFixtures>({
})
export const campaignPageChrome = (page: Page, title: string) =>
page.locator('[data-slot="campaign-page-chrome"]').getByText(title, { exact: true })
page
.locator('[data-slot="campaign-page-chrome"]')
.filter({ visible: true })
.getByText(title, { exact: true })
export { expect }