Heading
getHeading
Description: Retrieves the visible text from a specific element on the page. It's essential for validating that the UI displays the expected text content to users.
Example:
Pick up the title right here
import { getHeading } from 'foreplaywright'
export async function layoutCheck(page) {
await getHeading(page, "Pick up the title right here")
}
getHeadingPartialMatch
However for times you'd prefer a partial match, we've got you covered.
import { getHeadingPartialMatch } from 'foreplaywright'
export async function layoutCheck(page) {
await getHeadingPartialMatch(page, "Pick up the")
}
hoverHeading
Test:
This cool heading here
import { hoverHeading } from 'foreplaywright'
export async function layoutCheck(page) {
await hoverHeading(page, "This cool heading here")
}
clickHeading
Test:
This Heading.
import { clickHeading } from 'foreplaywright'
export async function layoutCheck(page) {
await clickHeading(page, "This Heading.")
}