diff --git a/javascript/node/selenium-webdriver/bidi/browsingContext.js b/javascript/node/selenium-webdriver/bidi/browsingContext.js index ec22aff2e296a..da0b58f857620 100644 --- a/javascript/node/selenium-webdriver/bidi/browsingContext.js +++ b/javascript/node/selenium-webdriver/bidi/browsingContext.js @@ -168,16 +168,11 @@ class BrowsingContext { throw Error(result['error']) } - const contexts = result['result']['contexts']; - const browsingContexts = contexts.map(context => { - return new BrowsingContextInfo( - context['id'], - context['url'], - context['children'], - context['parent'] - ); - }); - return browsingContexts; + const contexts = result['result']['contexts'] + const browsingContexts = contexts.map((context) => { + return new BrowsingContextInfo(context['id'], context['url'], context['children'], context['parent']) + }) + return browsingContexts } /** diff --git a/javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js b/javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js index 52488babb02df..d2b7e7a2d5407 100644 --- a/javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js @@ -447,18 +447,18 @@ suite( const devicePixelRatio = await driver.executeScript('return window.devicePixelRatio;') assert.equal(devicePixelRatio, 5) - }); + }) - it('Get All Top level browsing contexts', async ()=> { + it('Get All Top level browsing contexts', async () => { const id = await driver.getWindowHandle() const window1 = await BrowsingContext(driver, { browsingContextId: id, - }); - const window2 = await BrowsingContext(driver, {type: 'window'}); + }) + const window2 = await BrowsingContext(driver, { type: 'window' }) - const res = await window1.getTopLevelContexts(); - assert.equal(res.length, 2); - }); + const res = await window1.getTopLevelContexts() + assert.equal(res.length, 2) + }) }) }, { browsers: [Browser.FIREFOX] },