Puppetry
3.2.2
3.2.2
  • Welcome Puppetry
  • Getting Started
  • Project
  • Suite
  • Group
  • Target
    • Simple Target
    • iFrame Target
    • ShadowDOM Target
    • Chained Target
    • Shared Target
  • Test Case
  • Test Step / Action
    • Page Commands
    • Page Assertions
    • Target Commands
    • Target Assertions
  • Managing Records
  • Snippets
  • Running tests
    • Interactive Mode
    • Troubleshooting
  • Test Report
  • Export
    • Exporting as Jest Project (CI-friendly)
    • Exporting as Test Specification
  • Settings
  • Template Expressions
  • Testing Techniques
    • Testing Dynamic Content
    • Exhaustive Testing
    • Performance Testing
    • Visual Regression Testing
    • Testing Shadow DOM
    • Testing Google Analytics tracking code
    • Testing Chrome Extensions
    • Testing REST API
    • Mocking HTTP/S Requests
    • Testing Transactional Emails
      • Example with Restmail.net
      • Example with Mailinator
      • Example with IMAP bridge
      • Example with Google API
    • Testing Forms with Captcha
  • Version Control
  • Tips and Tricks
    • Embrace the Power of CSS
  • Command API
  • Test Application
Powered by GitBook
On this page
  • target.assertAttribute
  • target.assertProperty
  • target.assertVisible
  • target.assertHtml
  • target.assertText
  • target.assertBoundingBox
  • target.assertPosition
  • target.assertStyle
  • target.assertMatchesSelector
  • target.assertNodeCount
  • target.assertTextCount
  • target.assertContainsClass
  • target.assertScroll
  • target.assertScreenshot

Was this helpful?

  1. Test Step / Action

Target Assertions

PreviousTarget CommandsNextManaging Records

Last updated 4 years ago

Was this helpful?

target.assertAttribute

Asserts that the specified of a target satisfies the given constraint

target.assertProperty

target.assertVisible

Asserts that the element is currently available and visible. Available settings:

  • available on the page and observable - the target is available in the DOM and visible to the user (displayed, visible, opaque, within the viewport)

  • available on the page - the target is available in the DOM. It enables the following options

    • display: any/none/NOT none

    • visibility: any/hidden/NOT hidden

    • opacity: any/0/NOT 0

    • offset: any/within the viewport/out of the viewport

  • available, but NOT observable - the target is available in the DOM, not not visible to the user (display: none or visibility: hidden or opacity: 0 or out of the viewport)

  • NOT available on the page - the target is not available in the DOM

target.assertHtml

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

target.assertText

Asserts that the rendered text content of the focused element satisfies the given constraint. Unlike target.assertHtml this method takes pure text content without HTML, which approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.

target.assertBoundingBox

target.assertPosition

Asserts that target's position relative to other given target

target.assertStyle

target.assertMatchesSelector

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

target.assertNodeCount

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

target.assertTextCount

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

target.assertContainsClass

target.assertScroll

target.assertScreenshot

Asserts that screenshot of the target matches already approved one

Asserts that the specified of a target satisfies the given constraint

Asserts that the (size and position) of a target satisfies the given constraint

Asserts that the of a target matches the given value

Asserts that the specified class value exists in the .

Asserts that offset on the target satisfies the given constraint

property
bounding box
computed style
element's class attribute
scroll
attribute
target.assertAttribute
target.assertAttribute available assertions
target.assertProperty
target.assertProperty available assertions
target.assertVisible
target.assertHtml
target.assertText
target.assertBoundingBox
target.assertPosition
target.assertStyle
target.assertMatchesSelector
target.assertNodeCount
target.assertTextCount
target.assertContainsClass
target.assertScroll
target.assertScreenshot