freeCodeCamp/e2e/utils/alerts.ts

5 lines
204 B
TypeScript

import { expect, type Page } from '@playwright/test';
export const alertToBeVisible = async (page: Page, text: string) =>
await expect(page.getByRole('alert').filter({ hasText: text })).toBeVisible();