hubcap waittext

Wait for specific text to appear anywhere on the page.

When to use

Use waittext to block until a given text string appears in the page content. Use wait for element selectors. Use find to search without waiting.

Usage

hubcap waittext <text> [--timeout <duration>]

Arguments

ArgumentTypeRequiredDescription
textstringYesThe text string to wait for

Flags

FlagTypeDefaultDescription
—timeoutduration30sMaximum wait time

Output

FieldTypeDescription
textstringThe text that was matched
foundboolWhether the text was found
{"text":"Order confirmed","found":true}

Errors

ConditionExit codeStderr
Missing text argument1usage: hubcap waittext <text> [--timeout <duration>]
Chrome not connected2error: connecting to Chrome: ...
Text not found within timeout3error: timeout

Examples

Wait for a success message:

hubcap waittext 'Order confirmed'

Wait with a short timeout:

hubcap waittext 'Loading complete' --timeout 5s

Submit a form and wait for confirmation (chaining):

hubcap click '#submit' && hubcap waittext 'Thank you for your order'

See also

  • wait - Wait for an element by CSS selector
  • waitgone - Wait for an element to be removed from the DOM
  • find - Search for text without waiting
  • text - Get text content of an element