forked from enviPath/enviPy
Current Dev State
This commit is contained in:
31
static/js/ketcher2/node_modules/webdriverio/lib/commands/switchTab.js
generated
vendored
Normal file
31
static/js/ketcher2/node_modules/webdriverio/lib/commands/switchTab.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
*
|
||||
* Switch focus to a particular tab / window handle.
|
||||
*
|
||||
* @alias browser.switchTab
|
||||
* @param {String=} windowHandle window handle URL to focus on (if no handle was specified the command switches to the first available one)
|
||||
* @uses protocol/window, window/getTabIds, window/switchTab
|
||||
* @type window
|
||||
*
|
||||
*/
|
||||
|
||||
let switchTab = function (windowHandle) {
|
||||
/*!
|
||||
* parameter check
|
||||
*/
|
||||
if (typeof windowHandle !== 'string') {
|
||||
windowHandle = null
|
||||
}
|
||||
|
||||
if (windowHandle) {
|
||||
return this.window(windowHandle)
|
||||
}
|
||||
|
||||
return this.windowHandles().then((tabIds) => {
|
||||
if (tabIds && tabIds.value && tabIds.value.length) {
|
||||
return this.switchTab(tabIds.value[0])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export default switchTab
|
||||
Reference in New Issue
Block a user