Skip to main content

finder

A special object for constructing selectors.


getByRole

Uses the original playwright method.

getByText

Uses the original playwright method.

getByLabel

Uses the original playwright method.

getByPlaceholder

Uses the original playwright method.

getByAltText

Uses the original playwright method.

getByTitle

Uses the original playwright method.

getByTestId

Uses the original playwright method.

locator

Uses the original playwright method.

filter

Uses the original playwright method.

nth

Uses the original playwright method.

first

Uses the original playwright method.

last

Uses the original playwright method.

and

Uses the original playwright method.

get

Allows extending selectors using special transformers:

function byButtonSeverity(severity: string): FinderTransformer {
return (finder) => finder.get('button').filter({ hasText: severity });
}

finder.get(byButtonSeverity('error')); // <button class="error">Error</button>