From 3f559a32d108c9f45b1b718d11c988c148a5003a Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 15 Apr 2024 17:47:13 +0200 Subject: [PATCH] Update WebDriver.php: pressKey --- src/Codeception/Module/WebDriver.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index 2c5b578..7c9e8c5 100644 --- a/src/Codeception/Module/WebDriver.php +++ b/src/Codeception/Module/WebDriver.php @@ -3149,18 +3149,20 @@ protected function matchFirstOrFail(WebDriverSearchContext $page, $selector): We /** * Presses the given key on the given element. - * To specify a character and modifier (e.g. Ctrl, Alt, Shift, Meta), pass an array for `$char` with + * To specify a character and modifier (e.g. Ctrl, Alt, Shift, Meta), pass an array for `$char` with * the modifier as the first element and the character as the second. * For special keys, use the constants from [`Facebook\WebDriver\WebDriverKeys`](https://github.com/php-webdriver/php-webdriver/blob/main/lib/WebDriverKeys.php). * * ``` php * * $I->pressKey('#page', 'a'); // => olda - * $I->pressKey('#page', ['ctrl', 'a'],'new'); //=> new - * $I->pressKey('#page', ['shift', '111'],'1','x'); //=> old!!!1x - * $I->pressKey('descendant-or-self::*[@id='page']','u'); //=> oldu - * $I->pressKey('#name', ['ctrl', 'a'], \Facebook\WebDriver\WebDriverKeys::DELETE); //=>'' + * $I->pressKey('#page', ['ctrl', 'a'],'new'); // => new + * $I->pressKey('#page', ['shift', '111'],'1','x'); // => old!!!1x + * $I->pressKey('descendant-or-self::*[@id='page']','u'); // => oldu + * $I->pressKey('#name', ['ctrl', 'a'], WebDriverKeys::DELETE); // => '' * ``` * * @param string|array|WebDriverBy $element