text()
This selector lets you identify an element with text. Looks for exact match if not found does contains, accepts proximity selectors.
Examples
Section titled “Examples”await highlight(text('Vehicle'))await text('Vehicle').exists()await text('Vehicle', below('text')).exists()await text('Vehicle', { exactMatch: true }, below('text')).exists()await text('/Vehicle/').exists() //regex as stringawait text(/Vehicle/).exists()await text(new RegExp('Vehicle')).exists()Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
text | string | RegExp | Text/regex to match. |
_options | Object | |
_options.exactMatch | boolean | Option to look for exact match. Default: false. |
args | relativeSelector | Proximity selectors |
Returns
Section titled “Returns”| Type | Description |
|---|---|
| TextWrapper |