/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/tests/e2e/electron/helpers/snap.ts
12 строк
692 B
chrisnojima
build(mobile): harden gobuild.sh and go bind pipeline 2 (#29364)
08 июл 2026, 15:25
Не верифицирован
08 июл 2026, 15:25
19b55b3
Код
Авторство
О чём код?
import type {Page, TestInfo} from '@playwright/test' // Attach a screenshot of the current state under the name 'screenshot' — the same // name playwright's automatic end-of-test screenshot uses. The report generator // picks the FIRST attachment with that name, so calling this mid-test makes the // captured state (e.g. an open modal) the card image even though the test closes // the modal before ending. Call at the moment the screen shows what the card // should display; at most once per test. export async function snap(page: Page, testInfo: TestInfo): Promise<void> { const body = await page.screenshot() await testInfo.attach('screenshot', {body, contentType: 'image/png'}) }