|
23 | 23 | - [JavaScript Dialogs](#javascript-dialogs) |
24 | 24 | - [Scoping Selectors](#scoping-selectors) |
25 | 25 | - [Waiting For Elements](#waiting-for-elements) |
| 26 | + - [Scrolling An Element Into View](#scrolling-an-element-into-view) |
26 | 27 | - [Making Vue Assertions](#making-vue-assertions) |
27 | | - - [Scrolling An Element Into View](#scrolling-into-view) |
28 | 28 | - [Available Assertions](#available-assertions) |
29 | 29 | - [Pages](#pages) |
30 | 30 | - [Generating Pages](#generating-pages) |
@@ -623,6 +623,14 @@ Many of the "wait" methods in Dusk rely on the underlying `waitUsing` method. Yo |
623 | 623 | return $something->isReady(); |
624 | 624 | }, "Something wasn't ready in time."); |
625 | 625 |
|
| 626 | +<a name="scrolling-an-element-into-view"></a> |
| 627 | +### Scrolling An Element Into View |
| 628 | + |
| 629 | +Sometimes you may not be able to click on an element because it is outside of the viewable area of the browser. The `scrollIntoView` method will scroll the browser window until the element at the given selector is within the view: |
| 630 | + |
| 631 | + $browser->scrollIntoView('selector') |
| 632 | + ->click('selector'); |
| 633 | + |
626 | 634 | <a name="making-vue-assertions"></a> |
627 | 635 | ### Making Vue Assertions |
628 | 636 |
|
@@ -661,14 +669,6 @@ You may assert on the state of the Vue component like so: |
661 | 669 | }); |
662 | 670 | } |
663 | 671 |
|
664 | | -<a name="scrolling-into-view"></a> |
665 | | -### Scrolling An Element Into View |
666 | | - |
667 | | -The `scrollIntoView` method will scroll an element into view at the given selector. This is useful to call prior to interacting with an element that is not currently in view. |
668 | | - |
669 | | - $browser->scrollIntoView('selector') |
670 | | - ->click('selector'); |
671 | | - |
672 | 672 | <a name="available-assertions"></a> |
673 | 673 | ## Available Assertions |
674 | 674 |
|
|
0 commit comments