Page Assertions
Asserts that the page title satisfies the given constraint

page.assertTitle
Asserts that the page URL satisfies the given constraint

page.assertUrl
Asserts that the page content (HTML) satisfies the given constraint

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

page.assertNodeCount

page.assertScroll
Asserts that variable associated with a given name satisfies the given constraint

page.assertVar
Asserts that screenshot of the page matches already approved one

page.assertScreenshot

page.assertScreenshot advanced options
Makes HTTP/S request and asserts that the response satisfies the given constraint.
The method automatically assigns the response text data to template variable
PUPPETRY_LAST_RESPONSE_TEXT

page.assertRest
Asserts that the HTTP/S response satisfies the given constraint

page.assertResponse
Asserts there were (no) console messages sent to console to satisfy the given constraint

page.assertConsoleMessage
Asserts there was called a dialog (alert, beforeunload, confirm or prompt).

page.assertDialog
Asserts that total weight of assets (JavaScript, CSS, images, media, fonts, XHR) on the page satisfies the given budget.
This assertion makes Puppetry to intercept HTTP requests. It compares the given limits to the encoded length of the requests. Note that the request length is considered
0
when request loaded from cache. So it makes sense to place this step next to the very first page.goto
in the test suite.
page.assertPerformanceAssetWeight
Asserts that total number of requested assets (JavaScript, CSS, images, media, fonts, XHR) on the page satisfies the given budget.

page.assertPerformanceAssetCount

page.assertPerformanceTiming
Asserts a given action was sent to Google Analytics with analytics.js or gtag.js. We also assert that sent payloads are valid according to the Google API

page.assertGaTracking
Last modified 3yr ago