Skip to content

Commit

Permalink
pressKey: Fixing @param string|array<string|string> $chars (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasLandauer authored Dec 15, 2024
1 parent 5158e96 commit 57611e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Codeception/Module/WebDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3149,22 +3149,22 @@ protected function matchFirstOrFail(WebDriverSearchContext $page, $selector): We

/**
* Presses the given key on the given element.
* To specify a character and modifier (e.g. <kbd>Ctrl</kbd>, Alt, Shift, Meta), pass an array for `$char` with
* To specify a character and modifier (e.g. <kbd>Ctrl</kbd>, <kbd>Alt</kbd>, <kbd>Shift</kbd>, <kbd>Meta</kbd>), 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).
* For special keys, use the constants from [Facebook\WebDriver\WebDriverKeys](https://github.com/php-webdriver/php-webdriver/blob/main/lib/WebDriverKeys.php).
*
* ``` php
* <?php
* // <input id="page" value="old">
* $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'], \Facebook\WebDriver\WebDriverKeys::DELETE); // =>''
* ```
*
* @param string|array|WebDriverBy $element
* @param array<string|string[]>$chars Can be char or array with modifier. You can provide several chars.
* @param string|array<string, string> $chars Can be char or array with modifier. You can provide several chars.
* @throws ElementNotFound
*/
public function pressKey($element, ...$chars): void
Expand Down

0 comments on commit 57611e1

Please sign in to comment.