Skip to content

Commit

Permalink
[bidi][js] Add test to get iframe's browsing context
Browse files Browse the repository at this point in the history
  • Loading branch information
pujagani committed Jan 9, 2024
1 parent 46b3ac6 commit 4b6af2e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Expand Up @@ -67,6 +67,23 @@ suite(
assert.equal(result.result.value, 3)
})

it('can call function to get iframe browsing context', async function () {
await driver.get(Pages.iframePage)
const id = await driver.getWindowHandle()
const manager = await ScriptManager(id, driver)

const result = await manager.callFunctionInBrowsingContext(
id,
'() => document.querySelector(\'iframe[id="iframe1"]\').contentWindow',
false
)
assert.equal(result.resultType, EvaluateResultType.SUCCESS)
assert.notEqual(result.realmId, null)
assert.equal(result.result.type, 'window')
assert.notEqual(result.result.value, null)
assert.notEqual(result.result.value.context, null)
})

it('can call function with arguments', async function () {
const id = await driver.getWindowHandle()
const manager = await ScriptManager(id, driver)
Expand Down

0 comments on commit 4b6af2e

Please sign in to comment.