pull/5756/head
bunsenstraat 4 days ago committed by bunsenstraat
parent 1d1e2e1f3f
commit 68989fbea1
  1. 6
      apps/remix-ide-e2e/src/commands/switchBrowserTab.ts

@ -6,11 +6,13 @@ import EventEmitter from 'events'
*/
class SwitchBrowserTab extends EventEmitter {
command (this: NightwatchBrowser, index: number): NightwatchBrowser {
command(this: NightwatchBrowser, index: number): NightwatchBrowser {
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')

Loading…
Cancel
Save