hubcap waiturl

Wait for the page URL to match a pattern.

When to use

Use waiturl to block until the current page URL matches a given pattern. Use after clicking links or submitting forms that trigger navigation.

Usage

hubcap waiturl <pattern> [--timeout <duration>]

Arguments

ArgumentTypeRequiredDescription
patternstringYesURL pattern to match

Flags

FlagTypeDefaultDescription
—timeoutduration30sMaximum wait time

Output

FieldTypeDescription
patternstringThe pattern matched
urlstringThe URL that matched
{"pattern":"/dashboard","url":"https://example.com/dashboard"}

Errors

ConditionExit codeStderr
Missing pattern argument1usage: hubcap waiturl <pattern> [--timeout <duration>]
Chrome not connected2error: connecting to Chrome: ...
URL not matched within timeout3error: timeout

Examples

Wait for a redirect to the dashboard:

hubcap waiturl '/dashboard'

Wait for a URL containing a query parameter:

hubcap waiturl 'status=success' --timeout 10s

Submit a login form and wait for redirect (chaining):

hubcap click '#login-btn' && hubcap waiturl '/dashboard' --timeout 15s

See also

  • waitnav - Wait for any navigation event
  • waitload - Wait for the page load event
  • url - Get the current page URL
  • goto - Navigate to a URL