Skip to content

Commit 5c6be6d

Browse files
Update WebDriver.php: pressKey: Adding more consts
1 parent af40aff commit 5c6be6d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Codeception/Module/WebDriver.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,15 +3156,16 @@ protected function matchFirstOrFail(WebDriverSearchContext $page, $selector): We
31563156
* ``` php
31573157
* <?php
31583158
* // <input id="page" value="old">
3159+
* use Facebook\WebDriver\WebDriverKeys;
31593160
* $I->pressKey('#page', 'a'); // => olda
3160-
* $I->pressKey('#page', ['ctrl', 'a'],'new'); // => new
3161-
* $I->pressKey('#page', ['shift', '111'], '1', 'x'); // => old!!!1x
3161+
* $I->pressKey('#page', [WebDriverKeys::CONTROL, 'a'], 'new'); // => new
3162+
* $I->pressKey('#page', [WebDriverKeys::SHIFT, '111'], '1', 'x'); // => old!!!1x
31623163
* $I->pressKey('descendant-or-self::*[@id='page']', 'u'); // => oldu
3163-
* $I->pressKey('#name', ['ctrl', 'a'], \Facebook\WebDriver\WebDriverKeys::DELETE); // =>''
3164+
* $I->pressKey('#name', [WebDriverKeys::CONTROL, 'a'], WebDriverKeys::DELETE); // => ''
31643165
* ```
31653166
*
31663167
* @param string|array|WebDriverBy $element
3167-
* @param string|list<string> $chars Can be char or array with modifier. You can provide several chars.
3168+
* @param string|list<string> ...$chars A single character, or an array with a modifier key. Separate several `$chars` with comma.
31683169
* @throws ElementNotFound
31693170
*/
31703171
public function pressKey($element, ...$chars): void

0 commit comments

Comments
 (0)