Skip to content

Commit

Permalink
fix cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
bunsenstraat committed Feb 11, 2025
1 parent 3be04b8 commit 377f71d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/remix-ide-e2e/src/commands/switchBrowserTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 377f71d

Please sign in to comment.