Skip to content

Commit

Permalink
[nodejs] Making the newWindow test more tolerant to initial state
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Apr 13, 2019
1 parent bf20123 commit 6f7fe79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions javascript/node/selenium-webdriver/test/window_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ test.suite(function(env) {
});

it('can open a new window', async function() {
const originalHandle = await driver.getWindowHandle()
let originalHandles = await driver.getAllWindowHandles()
let originalHandle = await driver.getWindowHandle()

let newHandle = await driver.switchTo().newWindow()

assert.equal((await driver.getAllWindowHandles()).length, 2)
assert.equal((await driver.getAllWindowHandles()).length, originalHandles.length + 1)
assert.notEqual(originalHandle, newHandle)
})

Expand Down

0 comments on commit 6f7fe79

Please sign in to comment.