Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Codeception/Module/WebDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3156,15 +3156,16 @@ protected function matchFirstOrFail(WebDriverSearchContext $page, $selector): We
* ``` php
* <?php
* // <input id="page" value="old">
* use Facebook\WebDriver\WebDriverKeys;
* $I->pressKey('#page', 'a'); // => olda
* $I->pressKey('#page', ['ctrl', 'a'],'new'); // => new
* $I->pressKey('#page', ['shift', '111'], '1', 'x'); // => old!!!1x
* $I->pressKey('#page', [WebDriverKeys::CONTROL, 'a'], 'new'); // => new
* $I->pressKey('#page', [WebDriverKeys::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', [WebDriverKeys::CONTROL, 'a'], WebDriverKeys::DELETE); // => ''
* ```
*
* @param string|array|WebDriverBy $element
* @param string|list<string> $chars Can be char or array with modifier. You can provide several chars.
* @param string|list<string> ...$chars A single character, or an array with a modifier key. Separate several `$chars` with comma.
* @throws ElementNotFound
*/
public function pressKey($element, ...$chars): void
Expand Down
Loading