Skip to content

Latest commit

 

History

History
220 lines (127 loc) · 5.24 KB

Schema.WaitForElementStep.md

File metadata and controls

220 lines (127 loc) · 5.24 KB

@puppeteer/replay / Schema / WaitForElementStep

Interface: WaitForElementStep

Schema.WaitForElementStep

waitForElement allows waiting for the presence (or absence) of the number of elements identified by the selector.

For example, the following step would wait for less than three elements to be on the page that match the selector .my-class.

{
  "type": "waitForElement",
  "selectors": [".my-class"],
  "operator": "<=",
  "count": 2,
}

Hierarchy

Table of contents

Properties

Properties

assertedEvents

Optional assertedEvents: NavigationEvent[]

Inherited from

StepWithSelectors.assertedEvents

Defined in

Schema.ts:64


attributes

Optional attributes: Object

Whether to also check the element(s) for the given attributes.

Index signature

▪ [name: string]: string

Defined in

Schema.ts:273


count

Optional count: number

Default Value

1

Defined in

Schema.ts:256


frame

Optional frame: FrameSelector

Defaults to main frame

Inherited from

StepWithSelectors.frame

Defined in

Schema.ts:78


operator

Optional operator: ">=" | "==" | "<="

Default Value

'=='

Defined in

Schema.ts:252


properties

Optional properties: Partial<JSONSerializable<HTMLElement>> & { [key: string]: JSONValue; }

Whether to also check the element(s) for the given properties.

Defined in

Schema.ts:267


selectors

selectors: Selector[]

A list of alternative selectors that lead to selection of a single element to perform the step on. Currently, we support CSS selectors, ARIA selectors (start with 'aria/'), XPath selectors (start with xpath/) and text selectors (start with text/). Each selector could be a string or an array of strings. If it's a string, it means that the selector points directly to the target element. If it's an array, the last element is the selector for the target element and the preceding selectors point to the ancestor elements. If the parent element is a shadow root host, the subsequent selector is evaluated only against the shadow DOM of the host (i.e., parent.shadowRoot.querySelector). If the parent element is not a shadow root host, the subsequent selector is evaluated in the regular DOM (i.e., parent.querySelector).

During the execution, it's recommended that the implementation tries out all of the alternative selectors to improve reliability of the replay as some selectors might get outdated over time.

Inherited from

StepWithSelectors.selectors

Defined in

Schema.ts:100


target

Optional target: string

Defaults to main

Inherited from

StepWithSelectors.target

Defined in

Schema.ts:71


timeout

Optional timeout: number

Inherited from

StepWithSelectors.timeout

Defined in

Schema.ts:63


type

type: WaitForElement

Overrides

StepWithSelectors.type

Defined in

Schema.ts:248


visible

Optional visible: boolean

Whether to wait for elements matching this step to be hidden. This can be thought of as an inversion of this step.

Default Value

true

Defined in

Schema.ts:263