> For the complete documentation index, see [llms.txt](https://docs.puppetry.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.puppetry.app/master/test-step/target-assertions.md).

# Target Assertions

## target.assertAttribute

Asserts that the specified [attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes) of a target satisfies the given constraint

![](/files/-LhZhyLGXpIsxBFSGjMc)

## target.assertProperty

Asserts that the specified [property](https://developer.mozilla.org/en-US/docs/Web/API/Element) of a target satisfies the given constraint

![](/files/-LhZi-i0BR44ImAPonxI)

## target.assertVisible

Asserts that the element is currently visible in the current viewport ([intersecting](https://pptr.dev/#?product=Puppeteer\&version=v1.15.0\&show=api-elementhandleisintersectingviewport), styles `display` is not `none`, `visible` is not `hidden`, `opacity` is not `0`)

![](/files/-LhZi1xO1JvslB09UbNl)

## target.assertHtml

Asserts that the HTML content of the focused element satisfies the given constraint

![](/files/-LhZtdvwZ_xBklQjTx3u)

## target.assertBoundingBox

Asserts that the [bounding box](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) (size and position) of a target satisfies the given constraint

![](/files/-LhZiCSzQEc9x2kgk3kJ)

## target.assertPosition

Asserts that target's position relative to other given target

![](/files/-LhZiG0O5DwM8cRcp-eM)

## target.assertStyle

Asserts that the [computed style](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle) of a target matches the given value

![](/files/-LhZiKbc3gj6fjF-Ynw8)

## target.assertMatchesSelector

Asserts that a target matches a given selector or pseudo-selector

![](/files/-LhZiNp44w_A8uvTQSIq)

## target.assertNodeCount

Asserts that number of child elements matching a specified selector satisfies the given constraint.

![](/files/-LjpyfhTPeiI6krgboXz)

## target.assertTextCount

Asserts that number of child elements containing a specified text satisfies the given constraint.

![](/files/-LjpywrnQsTUpFSWPMCR)

## target.assertContainsClass

Asserts that the specified class value exists in the [element's class attribute](https://developer.mozilla.org/en-US/docs/Web/API/Element).

![](/files/-LhZiQR2Pl08Yui8r2Fs)

## target.assertScroll

Asserts that [scroll](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop) offset on the target satisfies the given constraint

![](/files/-LhZiTgawNn4IzCNn5CS)
