Launches a new tab. If url is provided, the new tab is opened with the url loaded.
Examples
await openTab('https://taiko.dev')
await openTab() # opens a blank tab.
await openTab('https://taiko.dev', {name: 'taiko'}) # Tab with identifier
Parameters
| Name |
Type |
Description |
targetUrl |
string |
Url of page to open in newly created tab. Default: undefined. |
options |
Object |
Default: {}. |
options.waitForNavigation |
boolean |
Wait for navigation after the reload. Default navigation timeout is 5000 milliseconds, to override pass { navigationTimeout: 10000 } in options parameter. Default: true. |
options.name |
string |
Tab identifier |
options.navigationTimeout |
number |
Navigation timeout value in milliseconds for navigation after click. Accepts value in milliseconds. Default: 5000. |
options.waitForStart |
number |
time to wait to check for occurrence of page load events. Accepts value in milliseconds. Default: 100. |
options.waitForEvents |
Array |
Page load events to implicitly wait for. Events available to wait for [‘DOMContentLoaded’, ‘loadEventFired’, ‘networkAlmostIdle’, ‘networkIdle’, ‘firstPaint’, ‘firstContentfulPaint’, ‘firstMeaningfulPaint’, ‘targetNavigated’] Default: []. |
Returns