remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/test-browser/commands/switchBrowserTab.js

21 lines
396 B

const EventEmitter = require('events')
/*
Switches between browser tabs
*/
class SwitchBrowserTab extends EventEmitter {
command (index) {
this.api.perform((browser, done) => {
browser.window_handles((result) => {
browser.switchWindow(result.value[index])
done()
})
this.emit('complete')
})
return this
}
}
module.exports = SwitchBrowserTab