Skip to content

Commit 881cd78

Browse files
committed
docs: add typeIntoElement command to docs in README
1 parent b645fa1 commit 881cd78

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,44 @@ Click an element on the page using semantic queries (`testing-library`-style) or
184184

185185
**Note:** Provide either semantic query parameters OR selector, not both.
186186

187+
### `typeIntoElement`
188+
Type text into an input element on the page using semantic queries (`testing-library`-style) or CSS selectors.
189+
190+
- Semantic Queries:
191+
- **Parameters:**
192+
- `queryType` (string, optional): Semantic query type. One of:
193+
- `"role"` - Find by ARIA role (e.g., "textbox", "searchbox")
194+
- `"text"` - Find by visible text content
195+
- `"labelText"` - Find form inputs by their label text
196+
- `"placeholderText"` - Find inputs by placeholder text
197+
- `"altText"` - Find images by alt text
198+
- `"testId"` - Find by data-testid attribute
199+
- `"title"` - Find by title attribute
200+
- `"displayValue"` - Find inputs by their current value
201+
- `queryValue` (string, required when using queryType): The value to search for
202+
- `text` (string, required): The text to type into the element
203+
- `queryOptions` (object, optional): Additional options:
204+
- `name` (string): Accessible name for role queries
205+
- `exact` (boolean): Whether to match exact text (default: true)
206+
- `hidden` (boolean): Include hidden elements (default: false)
207+
208+
- CSS Selectors:
209+
- **Parameters:**
210+
- `selector` (string, optional): CSS selector or XPath when semantic queries cannot locate the element
211+
- `text` (string, required): The text to type into the element
212+
213+
**Examples:**
214+
```javascript
215+
// Semantic queries (preferred)
216+
{ queryType: "labelText", queryValue: "Email Address", text: "[email protected]" }
217+
{ queryType: "placeholderText", queryValue: "Enter your name", text: "John Smith" }
218+
{ queryType: "role", queryValue: "textbox", queryOptions: { name: "Username" }, text: "john_doe" }
219+
220+
// CSS selector fallback
221+
{ selector: "#username", text: "john_doe" }
222+
{ selector: "input[name='email']", text: "[email protected]" }
223+
```
224+
225+
**Note:** Provide either semantic query parameters OR selector, not both.
226+
187227
</details>

0 commit comments

Comments
 (0)