temp-taiko
Version:
An easy to use wrapper over Chrome Remote Interface.
1 lines • 199 kB
JSON
[{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Launches a browser with a tab. The browser will be closed when the parent node.js process is closed."},{"type":"html","value":"<br>"},{"type":"text","value":"\nNote : "},{"type":"inlineCode","value":"openBrowser"},{"type":"text","value":" launches the browser in headless mode by default, but when "},{"type":"inlineCode","value":"openBrowser"},{"type":"text","value":" is called from "},{"type":"link","url":"repl","title":null,"jsdoc":true,"children":[{"type":"text","value":"repl"}]},{"type":"text","value":" it launches the browser in headful mode."}]}]},"tags":[{"title":"example","description":"await openBrowser({headless: false})\nawait openBrowser()\nawait openBrowser({args:['--window-size=1440,900']})\nawait openBrowser({args: [\n '--disable-gpu',\n '--disable-dev-shm-usage',\n '--disable-setuid-sandbox',\n '--no-first-run',\n '--no-sandbox',\n '--no-zygote']}) # These are recommended args that has to be passed when running in docker"},{"title":"param","description":"eg. {headless: true|false, args:['--window-size=1440,900']}","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"Object"}},"name":"options","default":"{headless:true}"},{"title":"param","description":"Option to open browser in headless/headful mode.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.headless","default":"true"},{"title":"param","description":"Args to open chromium. Refer https://peter.sh/experiments/chromium-command-line-switches/ for values.","type":{"type":"OptionalType","expression":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]}},"name":"options.args","default":"[]"},{"title":"param","description":"Remote host to connect to.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"options.host","default":"'127.0.0.1'"},{"title":"param","description":"Remote debugging port, if not given connects to any open port.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.port","default":"0"},{"title":"param","description":"Option to ignore certificate errors.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.ignoreCertificateErrors","default":"false"},{"title":"param","description":"Option to run each command after a delay. Useful to observe what is happening in the browser.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.observe","default":"false"},{"title":"param","description":"Option to modify delay time for observe mode. Accepts value in milliseconds.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.observeTime","default":"3000"},{"title":"param","description":"Option to dump IO from browser.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.dumpio","default":"false"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await openBrowser({headless: false})\nawait openBrowser()\nawait openBrowser({args:['--window-size=1440,900']})\nawait openBrowser({args: [\n '--disable-gpu',\n '--disable-dev-shm-usage',\n '--disable-setuid-sandbox',\n '--no-first-run',\n '--no-sandbox',\n '--no-zygote']}) # These are recommended args that has to be passed when running in docker"}],"implements":[],"params":[{"title":"param","name":"options","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"eg. {headless: true|false, args:"},{"type":"linkReference","identifier":"'--window-size=1440,900'","referenceType":"shortcut","children":[{"type":"text","value":"'--window-size=1440,900'"}]},{"type":"text","value":"}"}]}]},"type":{"type":"NameExpression","name":"Object"},"default":"{headless:true}","properties":[{"title":"param","name":"options.headless","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Option to open browser in headless/headful mode."}]}]},"type":{"type":"NameExpression","name":"boolean"},"default":"true"},{"title":"param","name":"options.args","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Args to open chromium. Refer "},{"type":"link","title":null,"url":"https://peter.sh/experiments/chromium-command-line-switches/","children":[{"type":"text","value":"https://peter.sh/experiments/chromium-command-line-switches/"}]},{"type":"text","value":" for values."}]}]},"type":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]},"default":"[]"},{"title":"param","name":"options.host","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Remote host to connect to."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"'127.0.0.1'"},{"title":"param","name":"options.port","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Remote debugging port, if not given connects to any open port."}]}]},"type":{"type":"NameExpression","name":"number"},"default":"0"},{"title":"param","name":"options.ignoreCertificateErrors","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Option to ignore certificate errors."}]}]},"type":{"type":"NameExpression","name":"boolean"},"default":"false"},{"title":"param","name":"options.observe","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Option to run each command after a delay. Useful to observe what is happening in the browser."}]}]},"type":{"type":"NameExpression","name":"boolean"},"default":"false"},{"title":"param","name":"options.observeTime","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Option to modify delay time for observe mode. Accepts value in milliseconds."}]}]},"type":{"type":"NameExpression","name":"number"},"default":"3000"},{"title":"param","name":"options.dumpio","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Option to dump IO from browser."}]}]},"type":{"type":"NameExpression","name":"boolean"},"default":"false"}]}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"openBrowser","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".openBrowser"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Closes the browser and along with all of its tabs."}]}]},"tags":[{"title":"example","description":"await closeBrowser()"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await closeBrowser()"}],"implements":[],"params":[],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"closeBrowser","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".closeBrowser"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Gives CRI client object (a wrapper around Chrome DevTools Protocol). Refer "},{"type":"link","title":null,"url":"https://github.com/cyrus-and/chrome-remote-interface","children":[{"type":"text","value":"https://github.com/cyrus-and/chrome-remote-interface"}]},{"type":"text","value":"\nThis is useful while writing plugins or if use some API of "},{"type":"link","title":null,"url":"https://chromedevtools.github.io/devtools-protocol/","children":[{"type":"text","value":"Chrome DevTools Protocol"}]},{"type":"text","value":"."}]}]},"tags":[{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Object"}}],"augments":[],"examples":[],"implements":[],"params":[],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Object"}}],"sees":[],"throws":[],"yields":[],"name":"client","kind":"function","memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".client"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Allows switching between tabs using URL or page title."}]}]},"tags":[{"title":"example","description":"await switchTo('https://taiko.gauge.org/') # switch using URL\nawait switchTo('Taiko') # switch using Title"},{"title":"param","description":"URL/Page title of the tab to switch.","type":{"type":"NameExpression","name":"string"},"name":"targetUrl"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await switchTo('https://taiko.gauge.org/') # switch using URL\nawait switchTo('Taiko') # switch using Title"}],"implements":[],"params":[{"title":"param","name":"targetUrl","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"URL/Page title of the tab to switch."}]}]},"type":{"type":"NameExpression","name":"string"}}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"switchTo","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".switchTo"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Add interceptor for the network call. Helps in overriding request or to mock response of a network call."}]}]},"tags":[{"title":"example","description":"# case 1: block URL :\nawait intercept(url)\n# case 2: mockResponse :\nawait intercept(url, {mockObject})\n# case 3: override request :\nawait intercept(url, (request) => {request.continue({overrideObject})})\n# case 4: redirect always :\nawait intercept(url, redirectUrl)\n# case 5: mockResponse based on request :\nawait intercept(url, (request) => { request.respond({mockResponseObject}) })\n# case 6: block URL twice:\nawait intercept(url, undefined, 2)\n# case 7: mockResponse only 3 times :\nawait intercept(url, {mockObject}, 3)"},{"title":"param","description":"request URL to intercept","type":{"type":"NameExpression","name":"string"},"name":"requestUrl"},{"title":"param","description":"action to be done after interception. For more examples refer to https://github.com/getgauge/taiko/issues/98#issuecomment-42024186","type":{"type":"UnionType","elements":[{"type":"NameExpression","name":"function"},{"type":"NameExpression","name":"Object"}]},"name":"option"},{"title":"param","description":"number of times the request has to be intercepted . Optional parameter","type":{"type":"NameExpression","name":"number"},"name":"count"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"# case 1: block URL :\nawait intercept(url)\n# case 2: mockResponse :\nawait intercept(url, {mockObject})\n# case 3: override request :\nawait intercept(url, (request) => {request.continue({overrideObject})})\n# case 4: redirect always :\nawait intercept(url, redirectUrl)\n# case 5: mockResponse based on request :\nawait intercept(url, (request) => { request.respond({mockResponseObject}) })\n# case 6: block URL twice:\nawait intercept(url, undefined, 2)\n# case 7: mockResponse only 3 times :\nawait intercept(url, {mockObject}, 3)"}],"implements":[],"params":[{"title":"param","name":"requestUrl","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"request URL to intercept"}]}]},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"option","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"action to be done after interception. For more examples refer to "},{"type":"link","title":null,"url":"https://github.com/getgauge/taiko/issues/98#issuecomment-42024186","children":[{"type":"text","value":"https://github.com/getgauge/taiko/issues/98#issuecomment-42024186"}]}]}]},"type":{"type":"UnionType","elements":[{"type":"NameExpression","name":"function"},{"type":"NameExpression","name":"Object"}]}},{"title":"param","name":"count","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"number of times the request has to be intercepted . Optional parameter"}]}]},"type":{"type":"NameExpression","name":"number"}}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"intercept","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".intercept"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Activates emulation of network conditions."}]}]},"tags":[{"title":"example","description":"await emulateNetwork(\"Offline\")\nawait emulateNetwork(\"Good2G\")"},{"title":"param","description":"'GPRS','Regular2G','Good2G','Good3G','Regular3G','Regular4G','DSL','WiFi, Offline'","type":{"type":"NameExpression","name":"string"},"name":"networkType"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await emulateNetwork(\"Offline\")\nawait emulateNetwork(\"Good2G\")"}],"implements":[],"params":[{"title":"param","name":"networkType","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"'GPRS','Regular2G','Good2G','Good3G','Regular3G','Regular4G','DSL','WiFi, Offline'"}]}]},"type":{"type":"NameExpression","name":"string"}}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"emulateNetwork","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".emulateNetwork"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Overrides the values of device screen dimensions according to a predefined list of devices. To provide custom device dimensions, use setViewPort API."}]}]},"tags":[{"title":"example","description":"await emulateDevice('iPhone 6')"},{"title":"param","description":"See [device model](https://github.com/getgauge/taiko/blob/master/lib/data/devices.js) for a list of all device models.","type":{"type":"NameExpression","name":"string"},"name":"deviceModel"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await emulateDevice('iPhone 6')"}],"implements":[],"params":[{"title":"param","name":"deviceModel","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"See "},{"type":"link","title":null,"url":"https://github.com/getgauge/taiko/blob/master/lib/data/devices.js","children":[{"type":"text","value":"device model"}]},{"type":"text","value":" for a list of all device models."}]}]},"type":{"type":"NameExpression","name":"string"}}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"emulateDevice","memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".emulateDevice"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Overrides the values of device screen dimensions"}]}]},"tags":[{"title":"example","description":"await setViewPort({width:600, height:800})"},{"title":"param","description":"See [chrome devtools setDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride) for a list of options","type":{"type":"NameExpression","name":"Object"},"name":"options"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await setViewPort({width:600, height:800})"}],"implements":[],"params":[{"title":"param","name":"options","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"See "},{"type":"link","title":null,"url":"https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride","children":[{"type":"text","value":"chrome devtools setDeviceMetricsOverride"}]},{"type":"text","value":" for a list of options"}]}]},"type":{"type":"NameExpression","name":"Object"}}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"setViewPort","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".setViewPort"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Changes the timezone of the page. See "},{"type":"link","title":null,"url":"https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1","children":[{"type":"inlineCode","value":"metaZones.txt"}]},{"type":"text","value":"\nfor a list of supported timezone IDs."}]}]},"tags":[{"title":"example","description":"await emulateTimezone('America/Jamaica')"}],"augments":[],"examples":[{"description":"await emulateTimezone('America/Jamaica')"}],"implements":[],"params":[{"title":"param","name":"timezoneId"}],"properties":[],"returns":[],"sees":[],"throws":[],"yields":[],"name":"emulateTimezone","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".emulateTimezone"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Launches a new tab. If url is provided, the new tab is opened with the url loaded."}]}]},"tags":[{"title":"example","description":"await openTab('https://taiko.gauge.org/')\nawait openTab() # opens a blank tab."},{"title":"param","description":"Url of page to open in newly created tab.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"targetUrl","default":"undefined"},{"title":"param","description":null,"type":{"type":"NameExpression","name":"Object"},"name":"options"},{"title":"param","description":"Wait for navigation after the reload. Default navigation timeout is 5000 milliseconds, to override pass `{ navigationTimeout: 10000 }` in `options` parameter.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.waitForNavigation","default":"true"},{"title":"param","description":"Navigation timeout value in milliseconds for navigation after click. Accepts value in milliseconds.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.navigationTimeout","default":"5000"},{"title":"param","description":"time to wait to check for occurrence of page load events. Accepts value in milliseconds.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.waitForStart","default":"100"},{"title":"param","description":"Page load events to implicitly wait for. Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint']]","type":{"type":"OptionalType","expression":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]}},"name":"options.waitForEvents","default":"['firstMeaningfulPaint']"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await openTab('https://taiko.gauge.org/')\nawait openTab() # opens a blank tab."}],"implements":[],"params":[{"title":"param","name":"targetUrl","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Url of page to open in newly created tab."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"},{"title":"param","name":"options","type":{"type":"NameExpression","name":"Object"},"properties":[{"title":"param","name":"options.waitForNavigation","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Wait for navigation after the reload. Default navigation timeout is 5000 milliseconds, to override pass "},{"type":"inlineCode","value":"{ navigationTimeout: 10000 }"},{"type":"text","value":" in "},{"type":"inlineCode","value":"options"},{"type":"text","value":" parameter."}]}]},"type":{"type":"NameExpression","name":"boolean"},"default":"true"},{"title":"param","name":"options.navigationTimeout","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Navigation timeout value in milliseconds for navigation after click. Accepts value in milliseconds."}]}]},"type":{"type":"NameExpression","name":"number"},"default":"5000"},{"title":"param","name":"options.waitForStart","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"time to wait to check for occurrence of page load events. Accepts value in milliseconds."}]}]},"type":{"type":"NameExpression","name":"number"},"default":"100"},{"title":"param","name":"options.waitForEvents","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Page load events to implicitly wait for. Events available to wait for "},{"type":"linkReference","identifier":"'domcontentloaded', 'loadeventfired', 'networkalmostidle', 'networkidle', 'firstpaint', 'firstcontentfulpaint', 'firstmeaningfulpaint'","referenceType":"shortcut","children":[{"type":"text","value":"'DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint'"}]},{"type":"text","value":"]"}]}]},"type":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]},"default":"['firstMeaningfulPaint']"}],"default":"{navigationTimeout:defaultConfig.navigationTimeout}"}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"openTab","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".openTab"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Closes the given tab with given URL or closes current tab."}]}]},"tags":[{"title":"example","description":"# Closes the current tab.\nawait closeTab()\n# Closes all the tabs with Title 'Open Source Test Automation Framework | Gauge'.\nawait closeTab('Open Source Test Automation Framework | Gauge')\n# Closes all the tabs with URL 'https://gauge.org'.\nawait closeTab('https://gauge.org')"},{"title":"param","description":"URL/Page title of the tab to close.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"targetUrl","default":"undefined"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"# Closes the current tab.\nawait closeTab()\n# Closes all the tabs with Title 'Open Source Test Automation Framework | Gauge'.\nawait closeTab('Open Source Test Automation Framework | Gauge')\n# Closes all the tabs with URL 'https://gauge.org'.\nawait closeTab('https://gauge.org')"}],"implements":[],"params":[{"title":"param","name":"targetUrl","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"URL/Page title of the tab to close."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"closeTab","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".closeTab"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Override specific permissions to the given origin"}]}]},"tags":[{"title":"example","description":"await overridePermissions('http://maps.google.com',['geolocation']);"},{"title":"param","description":"url origin to override permissions","type":{"type":"NameExpression","name":"string"},"name":"origin"},{"title":"param","description":"See [chrome devtools permission types](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#type-PermissionType) for a list of permission types.","type":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]},"name":"permissions"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await overridePermissions('http://maps.google.com',['geolocation']);"}],"implements":[],"params":[{"title":"param","name":"origin","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"url origin to override permissions"}]}]},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"permissions","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"See "},{"type":"link","title":null,"url":"https://chromedevtools.github.io/devtools-protocol/tot/Browser/#type-PermissionType","children":[{"type":"text","value":"chrome devtools permission types"}]},{"type":"text","value":" for a list of permission types."}]}]},"type":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]}}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"overridePermissions","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".overridePermissions"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Clears all permission overrides for all origins."}]}]},"tags":[{"title":"example","description":"await clearPermissionOverrides()"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await clearPermissionOverrides()"}],"implements":[],"params":[],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"clearPermissionOverrides","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".clearPermissionOverrides"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Sets a cookie with the given cookie data. It may overwrite equivalent cookie if it already exists."}]}]},"tags":[{"title":"example","description":"await setCookie(\"CSRFToken\",\"csrfToken\", {url: \"http://the-internet.herokuapp.com\"})\nawait setCookie(\"CSRFToken\",\"csrfToken\", {domain: \"herokuapp.com\"})"},{"title":"param","description":"Cookie name.","type":{"type":"NameExpression","name":"string"},"name":"name"},{"title":"param","description":"Cookie value.","type":{"type":"NameExpression","name":"string"},"name":"value"},{"title":"param","description":null,"type":{"type":"NameExpression","name":"Object"},"name":"options"},{"title":"param","description":"sets cookie with the URL.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"options.url","default":"undefined"},{"title":"param","description":"sets cookie with the exact domain.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"options.domain","default":"undefined"},{"title":"param","description":"sets cookie with the exact path.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"options.path","default":"undefined"},{"title":"param","description":"True if cookie to be set is secure.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.secure","default":"undefined"},{"title":"param","description":"True if cookie to be set is http-only.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.httpOnly","default":"undefined"},{"title":"param","description":"Represents the cookie's 'SameSite' status: Refer https://tools.ietf.org/html/draft-west-first-party-cookies.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"options.sameSite","default":"undefined"},{"title":"param","description":"UTC time in seconds, counted from January 1, 1970. eg: 2019-02-16T16:55:45.529Z","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.expires","default":"undefined"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await setCookie(\"CSRFToken\",\"csrfToken\", {url: \"http://the-internet.herokuapp.com\"})\nawait setCookie(\"CSRFToken\",\"csrfToken\", {domain: \"herokuapp.com\"})"}],"implements":[],"params":[{"title":"param","name":"name","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Cookie name."}]}]},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"value","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Cookie value."}]}]},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"options","type":{"type":"NameExpression","name":"Object"},"properties":[{"title":"param","name":"options.url","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"sets cookie with the URL."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"},{"title":"param","name":"options.domain","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"sets cookie with the exact domain."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"},{"title":"param","name":"options.path","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"sets cookie with the exact path."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"},{"title":"param","name":"options.secure","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"True if cookie to be set is secure."}]}]},"type":{"type":"NameExpression","name":"boolean"},"default":"undefined"},{"title":"param","name":"options.httpOnly","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"True if cookie to be set is http-only."}]}]},"type":{"type":"NameExpression","name":"boolean"},"default":"undefined"},{"title":"param","name":"options.sameSite","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Represents the cookie's 'SameSite' status: Refer "},{"type":"link","title":null,"url":"https://tools.ietf.org/html/draft-west-first-party-cookies","children":[{"type":"text","value":"https://tools.ietf.org/html/draft-west-first-party-cookies"}]},{"type":"text","value":"."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"},{"title":"param","name":"options.expires","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"UTC time in seconds, counted from January 1, 1970. eg: 2019-02-16T16:55:45.529Z"}]}]},"type":{"type":"NameExpression","name":"number"},"default":"undefined"}],"default":"{}"}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"setCookie","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".setCookie"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Deletes browser cookies with matching name and URL or domain/path pair. If cookie name is not given or empty, all browser cookies are deleted."}]}]},"tags":[{"title":"example","description":"await deleteCookies() # clears all browser cookies\nawait deleteCookies(\"CSRFToken\", {url: \"http://the-internet.herokuapp.com\"})\nawait deleteCookies(\"CSRFToken\", {domain: \"herokuapp.com\"})"},{"title":"param","description":"Cookie name.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"cookieName","default":"undefined"},{"title":"param","description":null,"type":{"type":"NameExpression","name":"Object"},"name":"options"},{"title":"param","description":"deletes all the cookies with the given name where domain and path match provided URL. eg: https://google.com","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"options.url","default":"undefined"},{"title":"param","description":"deletes only cookies with the exact domain. eg: google.com","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"options.domain","default":"undefined"},{"title":"param","description":"deletes only cookies with the exact path. eg: Google/Chrome/Default/Cookies/..","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"string"}},"name":"options.path","default":"undefined"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await deleteCookies() # clears all browser cookies\nawait deleteCookies(\"CSRFToken\", {url: \"http://the-internet.herokuapp.com\"})\nawait deleteCookies(\"CSRFToken\", {domain: \"herokuapp.com\"})"}],"implements":[],"params":[{"title":"param","name":"cookieName","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Cookie name."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"},{"title":"param","name":"options","type":{"type":"NameExpression","name":"Object"},"properties":[{"title":"param","name":"options.url","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"deletes all the cookies with the given name where domain and path match provided URL. eg: "},{"type":"link","title":null,"url":"https://google.com","children":[{"type":"text","value":"https://google.com"}]}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"},{"title":"param","name":"options.domain","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"deletes only cookies with the exact domain. eg: google.com"}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"},{"title":"param","name":"options.path","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"deletes only cookies with the exact path. eg: Google/Chrome/Default/Cookies/.."}]}]},"type":{"type":"NameExpression","name":"string"},"default":"undefined"}],"default":"{}"}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"deleteCookies","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".deleteCookies"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Get browser cookies"}]}]},"tags":[{"title":"example","description":"await getCookies()\nawait getCookies({urls:['https://the-internet.herokuapp.com']})"},{"title":"param","description":null,"type":{"type":"NameExpression","name":"Object"},"name":"options"},{"title":"param","description":"The list of URLs for which applicable cookies will be fetched","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"Array"}},"name":"options.urls","default":"undefined"},{"title":"returns","description":"Array of cookie objects","type":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Promise"},"applications":[{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"Object"}]}]}}],"augments":[],"examples":[{"description":"await getCookies()\nawait getCookies({urls:['https://the-internet.herokuapp.com']})"}],"implements":[],"params":[{"title":"param","name":"options","type":{"type":"NameExpression","name":"Object"},"properties":[{"title":"param","name":"options.urls","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"The list of URLs for which applicable cookies will be fetched"}]}]},"type":{"type":"NameExpression","name":"Array"},"default":"undefined"}],"default":"{}"}],"properties":[],"returns":[{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Array of cookie objects"}]}]},"title":"returns","type":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Promise"},"applications":[{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"Object"}]}]}}],"sees":[],"throws":[],"yields":[],"name":"getCookies","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".getCookies"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Overrides the Geolocation Position"}]}]},"tags":[{"title":"example","description":"await setLocation({ latitude: 27.1752868, longitude: 78.040009, accuracy:20 })"},{"title":"param","description":"Latitue, logitude and accuracy to set the location.","type":{"type":"NameExpression","name":"Object"},"name":"options"},{"title":"param","description":"Mock latitude","type":{"type":"NameExpression","name":"number"},"name":"options.latitude"},{"title":"param","description":"Mock longitude","type":{"type":"NameExpression","name":"number"},"name":"options.longitude"},{"title":"param","description":"Mock accuracy","type":{"type":"NameExpression","name":"number"},"name":"options.accuracy"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await setLocation({ latitude: 27.1752868, longitude: 78.040009, accuracy:20 })"}],"implements":[],"params":[{"title":"param","name":"options","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Latitue, logitude and accuracy to set the location."}]}]},"type":{"type":"NameExpression","name":"Object"},"properties":[{"title":"param","name":"options.latitude","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Mock latitude"}]}]},"type":{"type":"NameExpression","name":"number"}},{"title":"param","name":"options.longitude","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Mock longitude"}]}]},"type":{"type":"NameExpression","name":"number"}},{"title":"param","name":"options.accuracy","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Mock accuracy"}]}]},"type":{"type":"NameExpression","name":"number"}}]}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"setLocation","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".setLocation"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Opens the specified URL in the browser's tab. Adds "},{"type":"inlineCode","value":"http"},{"type":"text","value":" protocol to the URL if not present."}]}]},"tags":[{"title":"example","description":"await goto('https://google.com')\nawait goto('google.com')\nawait goto({ navigationTimeout:10000, headers:{'Authorization':'Basic cG9zdG1hbjpwYXNzd29y2A=='}})"},{"title":"param","description":"URL to navigate page to.","type":{"type":"NameExpression","name":"string"},"name":"url"},{"title":"param","description":null,"type":{"type":"NameExpression","name":"Object"},"name":"options"},{"title":"param","description":"Wait for navigation after the goto. Default navigationTimeout is 30 seconds to override pass `{ navigationTimeout: 10000 }` in `options` parameter.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.waitForNavigation","default":"true"},{"title":"param","description":"Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint']","type":{"type":"OptionalType","expression":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]}},"name":"options.waitForEvents","default":"['firstMeaningfulPaint']"},{"title":"param","description":"Navigation timeout value in milliseconds for navigation after click.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.navigationTimeout","default":"30000"},{"title":"param","description":"Map with extra HTTP headers.","type":{"type":"NameExpression","name":"Object"},"name":"options.headers"},{"title":"param","description":"time to wait for navigation to start. Accepts value in milliseconds.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.waitForStart","default":"100"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await goto('https://google.com')\nawait goto('google.com')\nawait goto({ navigationTimeout:10000, headers:{'Authorization':'Basic cG9zdG1hbjpwYXNzd29y2A=='}})"}],"implements":[],"params":[{"title":"param","name":"url","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"URL to navigate page to."}]}]},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"options","type":{"type":"NameExpression","name":"Object"},"properties":[{"title":"param","name":"options.waitForNavigation","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Wait for navigation after the goto. Default navigationTimeout is 30 seconds to override pass "},{"type":"inlineCode","value":"{ navigationTimeout: 10000 }"},{"type":"text","value":" in "},{"type":"inlineCode","value":"options"},{"type":"text","value":" parameter."}]}]},"type":{"type":"NameExpression","name":"boolean"},"default":"true"},{"title":"param","name":"options.waitForEvents","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Events available to wait for "},{"type":"linkReference","identifier":"'domcontentloaded', 'loadeventfired', 'networkalmostidle', 'networkidle', 'firstpaint', 'firstcontentfulpaint', 'firstmeaningfulpaint'","referenceType":"shortcut","children":[{"type":"text","value":"'DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint'"}]}]}]},"type":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]},"default":"['firstMeaningfulPaint']"},{"title":"param","name":"options.navigationTimeout","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Navigation timeout value in milliseconds for navigation after click."}]}]},"type":{"type":"NameExpression","name":"number"},"default":"30000"},{"title":"param","name":"options.headers","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Map with extra HTTP headers."}]}]},"type":{"type":"NameExpression","name":"Object"}},{"title":"param","name":"options.waitForStart","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"time to wait for navigation to start. Accepts value in milliseconds."}]}]},"type":{"type":"NameExpression","name":"number"},"default":"100"}],"default":"{navigationTimeout:defaultConfig.navigationTimeout}"}],"properties":[],"returns":[{"description":{"type":"root","children":[]},"title":"returns","type":{"type":"NameExpression","name":"Promise"}}],"sees":[],"throws":[],"yields":[],"name":"goto","kind":"function","async":true,"memberof":"taiko","scope":"static","members":{"global":[],"inner":[],"instance":[],"events":[],"static":[]},"namespace":".goto"},{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Reloads the page."}]}]},"tags":[{"title":"example","description":"await reload('https://google.com')\nawait reload('https://google.com', { navigationTimeout: 10000 })"},{"title":"param","description":"DEPRECATED URL to reload","type":{"type":"NameExpression","name":"string"},"name":"url"},{"title":"param","description":null,"type":{"type":"NameExpression","name":"Object"},"name":"options"},{"title":"param","description":"Wait for navigation after the reload. Default navigation timeout is 30 seconds, to override pass `{ navigationTimeout: 10000 }` in `options` parameter.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.waitForNavigation","default":"true"},{"title":"param","description":"Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint']","type":{"type":"OptionalType","expression":{"type":"TypeApplication","expression":{"type":"NameExpression","name":"Array"},"applications":[{"type":"NameExpression","name":"string"}]}},"name":"options.waitForEvents","default":"['firstMeaningfulPaint']"},{"title":"param","description":"Navigation timeout value in milliseconds for navigation after click.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.navigationTimeout","default":"30000"},{"title":"param","description":"time to wait for navigation to start. Accepts value in milliseconds.","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"number"}},"name":"options.waitForStart","default":"100"},{"title":"param","description":"Ignore Cache on reload - Default to false","type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"boolean"}},"name":"options.ignoreCache","default":"false"},{"title":"returns","description":null,"type":{"type":"NameExpression","name":"Promise"}}],"augments":[],"examples":[{"description":"await reload('https://google.com')\nawait reload('https://google.com', { navigationTimeout: 10000 })"}],"implements":[],"params":[{"title":"param","name":"url","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"DEPRECATED URL to reload"}]}]},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"options","type":{"type":"NameExpression","name":"Object"},"properties":[{"title":"param","name":"options.waitForNavigation","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Wait for navigation after the reload. Default navigation timeout is 30 seconds, to override pass "},{"type":"inlineCode","value":"{ navigationTimeout: 10000 }"},{"type":"text","value":" in "},{"type":"inlineCode