Skip to content

Commit

Permalink
Add note about new actions to example (DevExpress#51)
Browse files Browse the repository at this point in the history
* Add note about new scroll actions to example

Co-authored-by: titerman <[email protected]>
Co-authored-by: arminal <[email protected]>
  • Loading branch information
3 people authored Apr 7, 2021
1 parent c53c76f commit 9d99e4c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/scroll/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

**Test Code**: [index.js](index.js)

> UPDATE: TestCafe v1.14 includes dedicated scroll actions. You do not need to interact with off-screen elements or execute client-side code to scroll the webpage. Read the documentation for details:
>
> * [t.scroll](https://devexpress.github.io/testcafe/documentation/reference/test-api/testcontroller/scroll.html)
> * [t.scrollBy](https://devexpress.github.io/testcafe/documentation/reference/test-api/testcontroller/scrollby.html)
> * [t.scrollIntoView](https://devexpress.github.io/testcafe/documentation/reference/test-api/testcontroller/scrollintoview.html)
TestCafe [actions](https://devexpress.github.io/testcafe/documentation/guides/basic-guides/interact-with-the-page.html) have a built-in scrolling mechanism. In rare cases, you may need to scroll the page manually. This example demonstrates two common ways to do this: a `hover` action and a [ClientFunction](https://devexpress.github.io/testcafe/documentation/guides/basic-guides/obtain-client-side-info.html)

The test page has two buttons. They are located at 2000 px and 4000 px along the X-axis, respectively (both outside of the viewport).
The test page has two buttons. They are located at 2000 px and 4000 px along the X-axis (outside of the viewport), respectively.

The `index.js` file includes 2 tests.

Expand All @@ -25,4 +31,4 @@ The second test introduces two custom Client Functions that scroll the page:
| Parameter | Description |
|------------|-------------|
| `x` | the number of pixels by which the page is scrolled horizontally|
| `y` | the number of pixels by which the page is scrolled vertically.|
| `y` | the number of pixels by which the page is scrolled vertically|

0 comments on commit 9d99e4c

Please sign in to comment.