Assertions
Element style
The runner compares the computed value. Colors in any format are translated to the computed one for "equals" and "does not equal".
Named color
Named color
color: red → rgb(255, 0, 0)Hex color
Hex color
color: #1d7afc → rgb(29, 122, 252)Color with alpha
Color with alpha
background-color: rgba(0, 0, 0, 0.5)Modern color format
Modern color format
color: oklch(62% 0.2 260)Border color
Border color
border-color: green → rgb(0, 128, 0)Font size
Font size
font-size: 1.5rem → 24pxFont weight
Font weight
font-weight: bold → 700Text align
Text align
text-align: centerDisplay flex
Display flex
display: flexDisplay inline-block
Display inline-block
display: inline-blockVisibility hidden
visibility: hidden (element is invisible)Opacity
Opacity
opacity: 0.5Width and height
Width and height
width: 200px, height: 40pxz-index auto
z-index auto
z-index: auto (not positioned)z-index number
z-index number
position: relative, z-index: 10Style changed after 2s
Red
color: red → green, 2s after the clickElement class
Class names here are plain (not CSS modules), so they are stable.
Several classes
class="btn btn-primary is-active"One class
class="btn"No classes
fails for any has class, message shows no classesSimilar names
class="btn-primary-outline": has "btn-primary" failsClass toggled after 2s
"is-active" added 2s after the clickMedia loaded
Assert that an image, picture, video or audio element finished loading.
Loaded image

passesBroken image

fails: 404Image without src![Empty]()
fails: nothing to loadImage loaded after 2s![Delayed]()
passes once the image appearsPicture

checks the inner imgVideo
passesBroken video
fails: 404Audio
passesNot a media element
Plain div
fails: reports the tag name (div)Meta tags
The head of this page has these tags.
| Tag | Value |
|---|---|
title | Assertions playground | BugBug |
description | Fixtures for the new BugBug assertions. |
canonical | https://playground.bugbug.io/others/assertions |
robots | noindex, nofollow |
h1 | Assertions |
lang | en-US (set by Next.js) |
og:title | Assertions playground |
og:description | Open Graph description |
og:image | https://playground.bugbug.io/images/bugbug-recording.png |
og:url | https://playground.bugbug.io/others/assertions |
twitter:card | summary_large_image |
twitter:title | Assertions playground on X |
custom-tag | Custom value (custom name) |
twitter:description | Not set: only negative operators pass |
URL query parameters
Current query: (none)
Request response
Each button sends a fetch to /api/status/<code>. Use a URL pattern such as /api/status/404 or /api/status/*. Redirects record the 3xx status too.