Docs
API 1.39
Status
Actions

scroll

The `scroll` step.

Scrolls an element into view when given a target, or scrolls the page with the object form, for infinite-scroll lists. The object form needs to or until.

Type: target or object

#Keys

KeyTypeDescription
scroll.delay_msintegerThe pause between scrolls in milliseconds, from 0 to 10000. Defaults to 0.
scroll.maxintegerThe most scrolls to make, from 1 to 1000. Required with until (lint E002).
scroll.to"bottom" | "top"Where to scroll the page: bottom or top.
scroll.untilconditionKeeps scrolling until this condition holds or max scrolls have been made.

Every step also takes the common step keys: expect, id, if, name, on_error, optional, retry, side_effect, timeout_ms, x_kaab.

#Example

{
  "scroll": {
    "to": "bottom",
    "until": {
      "count": {
        "target": ".item",
        "min": 60
      }
    },
    "max": 20,
    "delay_ms": 300
  }
}

From the contract fixture loop-until-scroll, a program the test suite validates.

Was this page helpful?