Skip to content

Commit

Permalink
[JS] Fix stale element test and enable window tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harsha509 committed Apr 17, 2024
1 parent d04cbb5 commit e9ef7e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions javascript/node/selenium-webdriver/bidi/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ class Input {
},
}

let response = await this.bidi.send(command)

return response
return await this.bidi.send(command)
}

/**
Expand Down
4 changes: 2 additions & 2 deletions javascript/node/selenium-webdriver/test/stale_element_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test.suite(function (env) {
await driver.wait(until.stalenessOf(toBeDeleted), 5000)
})

xit('an element found in a different frame is stale', async function () {
it('an element found in a different frame is stale', async function () {
await driver.get(Pages.missedJsReferencePage)

var frame = await driver.findElement(By.css('iframe[name="inner"]'))
Expand All @@ -53,7 +53,7 @@ test.suite(function (env) {
var el = await driver.findElement(By.id('oneline'))
await driver.switchTo().defaultContent()
return el.getText().then(assert.fail, function (e) {
assert.ok(e instanceof error.StaleElementReferenceError, `The error is ${JSON.stringify(e)}`)
assert.ok(e instanceof error.NoSuchElementError)
})
})
})
4 changes: 2 additions & 2 deletions javascript/node/selenium-webdriver/test/window_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test.suite(function (env) {
assert.strictEqual(await driver.getTitle(), 'We Arrive Here')
})

xit('can set the window position of the current window', async function () {
it('can set the window position of the current window', async function () {
let { x, y } = await driver.manage().window().getRect()
let newX = x + 10
let newY = y + 10
Expand All @@ -90,7 +90,7 @@ test.suite(function (env) {
await driver.wait(forPositionToBe(newX, newY), 1000)
})

xit('can set the window position from a frame', async function () {
it('can set the window position from a frame', async function () {
await driver.get(test.Pages.iframePage)

let frame = await driver.findElement(By.name('iframe1-name'))
Expand Down

0 comments on commit e9ef7e0

Please sign in to comment.