enso/app/gui2/e2e/customExpect.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
397 B
TypeScript
Raw Normal View History

import { expect, type Locator } from 'playwright/test'
/** Ensures that at least one of the elements that the Locator points to,
* is an attached and visible DOM node. */
export function toExist(locator: Locator) {
// Counter-intuitive, but correct:
// https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-visible
return expect(locator.first()).toBeVisible()
}