/
githubmirror
/
ionic
Обзор
Документация
Войти
/
githubmirror
/
ionic
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
core/src/components/modal/test/fixtures.ts
34 строки
1 KB
Maria Hutt
test(many): gestures flakiness (#27808)
14 авг 2023, 23:12
Не верифицирован
14 авг 2023, 23:12
eafa7b5
Код
Авторство
О чём код?
import { dragElementBy } from '@utils/test/playwright'; import type { E2EPage, EventSpy, E2EPageOptions } from '@utils/test/playwright'; export class CardModalPage { private ionModalDidPresent!: EventSpy; private ionModalDidDismiss!: EventSpy; private page: E2EPage; constructor(page: E2EPage) { this.page = page; } async navigate(url: string, config: E2EPageOptions) { const { page } = this; await page.goto(url, config); this.ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); this.ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss'); } async openModalByTrigger(selector: string) { await this.page.locator(selector).click(); await this.ionModalDidPresent.next(); return this.page.locator('ion-modal'); } async swipeToCloseModal(selector: string, waitForDismiss = true, swipeY = 300) { const { page } = this; const elementRef = page.locator(selector); await dragElementBy(elementRef, page, 0, swipeY); if (waitForDismiss) { await this.ionModalDidDismiss.next(); } } }