Skip to content

Commit

Permalink
docs: Add position option to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtrKovalenko committed Nov 29, 2020
1 parent 8661566 commit 1ec806d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,22 @@ cy.get("button").realClick();
cy.get("button").realClick(options);
```

Example:

```js
cy.get("button").realClick({ position: "topLeft" }) // click on the top left corner of button
cy.get("body").realClick({ x: 100, y: 1240 }) // click by the x & y coordinates relative to the whole window
```

Options:

- `Optional` **button**: \"none\" \| \"left\" \| \"right\" \| \"middle\" \| \"back\" \| \"forward\"
- `Optional` **pointer**: \"mouse\" \| \"pen\"
- `Optional` x coordinate to click **x**: number
- `Optional` y coordinate to click **y**: number
- `Optional` **position**: "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight"

> Make sure that `x` and `y` has bigger priority than `position`.
## cy.realHover

Expand All @@ -105,6 +117,7 @@ cy.get("button").hover(options);
Options:

- `Optional` **pointer**: \"mouse\" \| \"pen\"
- `Optional` **position**: "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight"

## cy.realPress

Expand Down

0 comments on commit 1ec806d

Please sign in to comment.