UNPKG

@bhavinkumarvegad/playwright-email-utils

Version:

Reusable utilities for handling emails in Playwright tests from Yopmail, Gmail and other providers.

35 lines (34 loc) 751 B
import { Page } from '@playwright/test'; export type Selector = { type: 'role'; value: { role: Parameters<Page['getByRole']>[0]; name?: string; }; } | { type: 'text'; value: string; } | { type: 'locator'; value: string; }; export type EmailAction = { selector: Selector; action: 'click' | 'textContent' | 'getAttribute'; attributeName?: string; description: string; }; export interface EmailQuery { subject?: string; from?: string; to?: string; afterTime?: string; beforeTime?: string; } export interface EmailExtractionRule { field: string; type: 'between-markers' | 'regex' | 'full-text'; startMarker?: string; endMarker?: string; regex?: RegExp; }