press
Presses the given keys.
Examples
await press('Enter')
await press('a')
await press(['Shift', 'ArrowLeft', 'ArrowLeft'])
awaitpress('a', { waitForNavigation: false })
Parameters
-
keys
-
Name of keys to press. See USKeyboardLayout for a list of all key names.
-
options
-
options.text
string -
If specified, generates an input event with this text.
- Default value
-
""
-
options.delay
number -
Time to wait between keydown and keyup in milliseconds.
- Default value
-
0
-
options.waitForNavigation
boolean -
Wait for navigation after the click. Default navigation timeout is 30 seconds, to override pass
{ navigationTimeout: 10000 }
inoptions
parameter.- Default value
-
true
-
options.waitForStart
number -
wait for navigation to start.
- Default value
-
100
-
options.navigationTimeout
number -
Navigation timeout value in milliseconds for navigation after click.
- Default value
-
30000
-
options.waitForEvents
Array<string> -
Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint', 'targetNavigated']
- Default value
-
[]
Returns
Promise<void>