QUESTPIE Probe
Commands

qprobe assert

Assert page content, URL, title, status, and absence of errors.

qprobe assert

Run assertions against the current browser state or last HTTP response. Exits with code 1 on failure.

qprobe assert <type> [value]

Assertion Types

TypeDescriptionExample
text "<string>"Page body contains text (case-sensitive)qprobe assert text "Welcome"
no-text "<string>"Page body does NOT contain textqprobe assert no-text "Error"
element <ref|selector>Element exists in interactive snapshotqprobe assert element @e3
url "<pattern>"Current URL matches regex patternqprobe assert url "/dashboard"
title "<string>"Page title contains text (case-sensitive)qprobe assert title "Dashboard"
status <code> <path>HTTP endpoint returns status codeqprobe assert status 200 /api/health
no-errorsNo uncaught JS exceptions in consoleqprobe assert no-errors
no-network-errorsNo 4xx/5xx HTTP responsesqprobe assert no-network-errors

Examples

# Check page content (case-sensitive)
qprobe assert text "Welcome back"
qprobe assert no-text "Something went wrong"

# Check navigation
qprobe assert url "/dashboard"
qprobe assert title "Dashboard - MyApp"

# Check element from snapshot
qprobe assert element @e3
qprobe assert element "#user-avatar"

# Check HTTP endpoint (TWO args: code + path)
qprobe assert status 200 /api/health
qprobe assert status 404 /api/nonexistent

# Check for errors (requires open browser)
qprobe assert no-errors
qprobe assert no-network-errors

# Chain in scripts
qprobe assert status 200 /api/health && \
qprobe assert no-errors && \
echo "All checks passed"

Output

# Success
qprobe assert text "Dashboard"
# ✅ Page contains "Dashboard"

# Failure
qprobe assert no-errors
# ❌ Found 2 JS error(s):
#   TypeError: Cannot read properties of undefined (reading 'map')
#   ReferenceError: user is not defined

qprobe assert status 200 /api/health
# ❌ http://localhost:3000/api/health returned 500, expected 200

Notes

  • text / no-text are case-sensitive
  • url pattern is a JavaScript RegExp (not glob) — escape dots: "localhost\\.com"
  • status requires two arguments: expected code and URL path
  • no-errors and no-network-errors require an open browser session

Exit Codes

  • 0 — Assertion passed
  • 1 — Assertion failed

On this page