UNPKG

@augment-vir/test

Version:

A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.

19 lines (18 loc) 506 B
import { expect } from '@playwright/test'; /** * Expects that all matches for the given locator are either visible or hidden (controlled by * `isVisible`). * * @category Internal */ export async function expectAllVisible(locator, isVisible) { const count = await locator.count(); for (let i = 0; i < count; i++) { if (isVisible) { await expect(locator.nth(i)).toBeVisible(); } else { await expect(locator.nth(i)).toBeHidden(); } } }