StrikekitStrikekit

accept cookies

Dismiss a cookie / consent banner via a fixed button allowlist

No-arg helper that clicks the first unique visible allowlist button for cookie / consent banners.

Syntax

When I accept cookies

Requirements

ItemContract
Element / control shapeAllowlist labels resolved via general resolve (same as labeled click/fill chain) — typically real buttons matching the allowlist text
How the label bindsFixed allowlist order below; first unique visible hit wins
Qualifiers that change resolveNone (no-arg command)
PlatformWeb only (v1)
Wrong shape → use insteadCustom consent copy → click on the exact label. Browser dialogs → accept

See also UI contracts.

Allowlist (order)

  1. Accept all
  2. Accept All
  3. Accept
  4. Agree
  5. I agree

First unique visible hit wins. Zero matches → clear error. Does not scan the whole DOM with CSS.

Examples

When I accept cookies
Then I should see "Cookies: accepted"

Notes

  • Distinct from accept (browser dialogs).
  • Each allowlist attempt uses labeled action resolve (auto-wait).
  • Web only for v1. You can still click on "Accept all" manually.

On this page