Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
🛠 browser: newPage() should activate page by default
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsweet committed Aug 18, 2018
1 parent 2a3a1d5 commit aee3c81
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/api/Browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ class Browser extends EventEmitter {
})

const pages: number[] = await this._send('WebDriver:GetWindowHandles')
const newPageId = pages[pages.length - 1]

await this._send('WebDriver:SwitchToWindow', {
name: newPageId,
focus: true
})

return new Page({
browser: this,
id: pages[pages.length - 1],
id: newPageId,
send: this._send
})
}
Expand Down

0 comments on commit aee3c81

Please sign in to comment.