Skip to content

Commit

Permalink
[10.x] Dusk - Add Keyboard Support Improvements documentation
Browse files Browse the repository at this point in the history
PR: laravel/dusk#1053

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Sep 6, 2023
1 parent 87030fc commit e6d1f65
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dusk.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,20 @@ Another valuable use case for the `keys` method is sending a "keyboard shortcut"
> **Note**
> All modifier keys such as `{command}` are wrapped in `{}` characters, and match the constants defined in the `Facebook\WebDriver\WebDriverKeys` class, which can be [found on GitHub](https://github.com/php-webdriver/php-webdriver/blob/master/lib/WebDriverKeys.php).
<a name="advanced-keyboard-interactions"></a>
#### Advanced Keyboard Interactions

Dusk also include `withKeyboard` method to allow you to use complex keyboard interactions such as `press`, `release` using `Laravel\Dusk\Keyboard` class:

use Laravel\Dusk\Keyboard;

$browser->withKeyboard(function (Keyboard $keyboard) {
$keyboard->press('c')
->pause(1000)
->release('c');
});


<a name="using-the-mouse"></a>
### Using The Mouse

Expand Down Expand Up @@ -708,6 +722,10 @@ The `clickAndHold` method may be used to simulate a mouse button being clicked a
->pause(1000)
->releaseMouse();

The `controlClick` method may be used to simulate `ctrl+click` event to the browser:

$browser->controlClick();

<a name="mouseover"></a>
#### Mouseover

Expand Down

0 comments on commit e6d1f65

Please sign in to comment.