Waits for the page’s URL to match a specific string, glob pattern, or predicate. Useful for waiting for navigations or redirects to complete. Example: waitForURL(urlOrPredicate: "**/profile/**", options: { waitUntil: LOAD }) Returns true if the URL matches within the timeout and wait conditions.

Definition

waitForURL(
  urlOrPredicate: String!
  options: WaitForOptions
): Boolean!

Arguments

urlOrPredicate

String! A URL string, glob pattern, or JavaScript predicate string to match against the page URL. Example: "https://example.com/dashboard" or "**/login?success=true"

options

WaitForOptions Options for waiting, such as timeout and lifecycle event to wait for.

Returns

Boolean! The Boolean scalar type represents true or false.