Skip to content

Commit b2a8448

Browse files
committed
[bidi][js] Add test for node properties in
1 parent f58416b commit b2a8448

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

javascript/node/selenium-webdriver/test/bidi/script_test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ suite(
8484
assert.notEqual(result.result.value.context, null)
8585
})
8686

87+
it('can call function to get element', async function () {
88+
await driver.get(Pages.logEntryAdded)
89+
const id = await driver.getWindowHandle()
90+
const manager = await ScriptManager(id, driver)
91+
92+
const result = await manager.callFunctionInBrowsingContext(
93+
id,
94+
'() => document.getElementById(\"consoleLog\")',
95+
false
96+
)
97+
assert.equal(result.resultType, EvaluateResultType.SUCCESS)
98+
assert.notEqual(result.realmId, null)
99+
assert.equal(result.result.type, 'node')
100+
assert.notEqual(result.result.value, null)
101+
assert.notEqual(result.result.value.nodeType, null)
102+
})
103+
87104
it('can call function with arguments', async function () {
88105
const id = await driver.getWindowHandle()
89106
const manager = await ScriptManager(id, driver)

0 commit comments

Comments
 (0)