Skip to content

Commit 016dc0a

Browse files
Copilothawkeyexl
andauthored
Add CSS and XPath selector guidance pages (#94)
* Initial plan * Add CSS and XPath selector guidance pages Co-authored-by: hawkeyexl <[email protected]> * Content revisions * Updated nav structure and added xrefs * Typo fix * Style fix --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: hawkeyexl <[email protected]> Co-authored-by: hawkeyexl <[email protected]>
1 parent d6f145e commit 016dc0a

File tree

9 files changed

+1009
-55
lines changed

9 files changed

+1009
-55
lines changed

docs/get-started/actions/click.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If you need to find an element before clicking it, consider using the [`find`](/
2828
When using the object format, you can specify:
2929

3030
- `button`: (Optional) Kind of click to perform. Can be `"left"`, `"right"`, or `"middle"`. Default is `"left"`.
31-
- `selector`: (Optional) CSS or XPath selector of the element to click. If combined with `elementText`, the element must match both the text and the selector.
31+
- `selector`: (Optional) [CSS selector](/docs/get-started/selectors/css) or [XPath selector](/docs/get-started/selectors/xpath) of the element to click. If combined with `elementText`, the element must match both the text and the selector.
3232
- `elementText`: (Optional) Display text of the element to click. If combined with `selector`, the element must match both the text and the selector.
3333

3434
> For comprehensive options, see the full [`click`](/docs/references/schemas/click) reference.

docs/get-started/actions/dragAndDrop.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Drag-and-drop has many different implementations, and Doc Detective wants to sup
2222

2323
:::
2424

25-
## Use Cases
25+
## Use cases
2626

2727
The `dragAndDrop` action is particularly useful for testing:
2828

@@ -40,12 +40,12 @@ The `dragAndDrop` action requires an object with the following properties:
4040
- `source`: (Required) The element to drag from. Can be a string (element text or selector) or a detailed object.
4141
- `target`: (Required) The element to drop onto. Can be a string (element text or selector) or a detailed object.
4242

43-
### Source and Target Element Properties
43+
### Source and target element properties
4444

4545
When using detailed objects for `source` or `target`, you can specify:
4646

4747
- `elementText`: (Optional) Display text of the element. If combined with `selector`, the element must match both the text and the selector.
48-
- `selector`: (Optional) CSS or XPath selector of the element. If combined with `elementText`, the element must match both the text and the selector.
48+
- `selector`: (Optional) [CSS selector](/docs/get-started/selectors/css) or [XPath selector](/docs/get-started/selectors/xpath) of the element. If combined with `elementText`, the element must match both the text and the selector.
4949
- `timeout`: (Optional) Maximum duration in milliseconds to wait for this specific element to exist.
5050

5151
> For comprehensive options, see the full [`dragAndDrop`](/docs/references/schemas/draganddrop) reference.
@@ -100,7 +100,7 @@ Here are several ways you might use the `dragAndDrop` action:
100100
}
101101
```
102102

103-
## Related Actions
103+
## Related actions
104104

105105
- [`click`](/docs/get-started/actions/click): Click elements to interact with them
106106
- [`find`](/docs/get-started/actions/find): Locate elements before performing other actions

docs/get-started/actions/find.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can specify the target element directly using a string (for simple text or s
2222
- Example: `"find": "Login"` or `"find": "#username"`.
2323
- **Object Format:** Use an object with the following properties:
2424
- `elementText`: (Optional) The display text of the element to find. If combined with `selector`, the element must match both.
25-
- `selector`: (Optional) The CSS or XPath selector of the element to find. If combined with `elementText`, the element must match both. *At least one of `elementText` or `selector` is required.*
25+
- `selector`: (Optional) The [CSS selector](/docs/get-started/selectors/css) or [XPath selector](/docs/get-started/selectors/xpath) of the element to find. If combined with `elementText`, the element must match both. *At least one of `elementText` or `selector` is required.*
2626
- `timeout`: (Optional) Maximum duration in milliseconds to wait for the element to exist (default: 5000).
2727
- `moveTo`: (Optional) Move the cursor to the element. If the element isn't visible, it's scrolled into view (default: `true`).
2828
- `click`: (Optional) Click the element after finding it. Can be `true` (for a default left click), `"left"`, `"right"`, `"middle"`, or an object like `{ "button": "right" }`.

docs/get-started/actions/screenshot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You can specify the screenshot action in several ways:
2727
- `always`: Always overwrite the reference image with the new capture.
2828
- `aboveVariation`: Overwrite only if the visual difference exceeds `maxVariation`.
2929
- `crop`: (Optional) Crop the screenshot to a specific element. Provide a CSS/XPath selector string (e.g., `"#myElement"`) or an object:
30-
- `selector`: (Required in object) The CSS or XPath selector of the element to crop to.
30+
- `selector`: (Required in object) The [CSS selector](/docs/get-started/selectors/css) or [XPath selector](/docs/get-started/selectors/xpath) of the element to crop to.
3131
- `elementText`: (Optional) Display text to further specify the element if the selector isn't unique.
3232
- `padding`: (Optional) Add padding around the element before cropping. Can be a single number (all sides) or an object `{ top, right, bottom, left }`.
3333

0 commit comments

Comments
 (0)