|
|
|
@ -10,7 +10,9 @@ class SwitchBrowserTab extends EventEmitter { |
|
|
|
|
this.api.perform((browser: NightwatchAPI, done) => { |
|
|
|
|
browser.windowHandles((result) => { |
|
|
|
|
console.log('switching to window', result) |
|
|
|
|
browser.switchWindow(result.value[index]) |
|
|
|
|
if (Array.isArray(result.value)) { |
|
|
|
|
browser.switchWindow(result.value[result.value[index] ? index : 0]) |
|
|
|
|
} |
|
|
|
|
done() |
|
|
|
|
}) |
|
|
|
|
this.emit('complete') |
|
|
|
|