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
| Type | Description | Example |
|---|---|---|
text "<string>" | Page body contains text (case-sensitive) | qprobe assert text "Welcome" |
no-text "<string>" | Page body does NOT contain text | qprobe assert no-text "Error" |
element <ref|selector> | Element exists in interactive snapshot | qprobe assert element @e3 |
url "<pattern>" | Current URL matches regex pattern | qprobe assert url "/dashboard" |
title "<string>" | Page title contains text (case-sensitive) | qprobe assert title "Dashboard" |
status <code> <path> | HTTP endpoint returns status code | qprobe assert status 200 /api/health |
no-errors | No uncaught JS exceptions in console | qprobe assert no-errors |
no-network-errors | No 4xx/5xx HTTP responses | qprobe 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 200Notes
text/no-textare case-sensitiveurlpattern is a JavaScript RegExp (not glob) — escape dots:"localhost\\.com"statusrequires two arguments: expected code and URL pathno-errorsandno-network-errorsrequire an open browser session
Exit Codes
0— Assertion passed1— Assertion failed