@@ -27,19 +27,21 @@ const until = require('../../lib/until')
2727suite (
2828 function ( env ) {
2929 let driver
30+ let browsingcontextInspector
3031
3132 beforeEach ( async function ( ) {
3233 driver = await env . builder ( ) . build ( )
3334 } )
3435
3536 afterEach ( async function ( ) {
37+ await browsingcontextInspector . close ( )
3638 await driver . quit ( )
3739 } )
3840
3941 describe ( 'Browsing Context Inspector' , function ( ) {
4042 it ( 'can listen to window browsing context created event' , async function ( ) {
4143 let contextInfo = null
42- const browsingcontextInspector = await BrowsingContextInspector ( driver )
44+ browsingcontextInspector = await BrowsingContextInspector ( driver )
4345 await browsingcontextInspector . onBrowsingContextCreated ( ( entry ) => {
4446 contextInfo = entry
4547 } )
5456
5557 it ( 'can listen to browsing context destroyed event' , async function ( ) {
5658 let contextInfo = null
57- const browsingcontextInspector = await BrowsingContextInspector ( driver )
59+ browsingcontextInspector = await BrowsingContextInspector ( driver )
5860 await browsingcontextInspector . onBrowsingContextDestroyed ( ( entry ) => {
5961 contextInfo = entry
6062 } )
7274
7375 it ( 'can listen to tab browsing context created event' , async function ( ) {
7476 let contextInfo = null
75- const browsingcontextInspector = await BrowsingContextInspector ( driver )
77+ browsingcontextInspector = await BrowsingContextInspector ( driver )
7678 await browsingcontextInspector . onBrowsingContextCreated ( ( entry ) => {
7779 contextInfo = entry
7880 } )
8789 } )
8890
8991 it ( 'can listen to dom content loaded event' , async function ( ) {
90- const browsingcontextInspector = await BrowsingContextInspector ( driver )
92+ browsingcontextInspector = await BrowsingContextInspector ( driver )
9193 let navigationInfo = null
9294 await browsingcontextInspector . onDomContentLoaded ( ( entry ) => {
9395 navigationInfo = entry
@@ -104,7 +106,7 @@ suite(
104106
105107 it ( 'can listen to browsing context loaded event' , async function ( ) {
106108 let navigationInfo = null
107- const browsingcontextInspector = await BrowsingContextInspector ( driver )
109+ browsingcontextInspector = await BrowsingContextInspector ( driver )
108110
109111 await browsingcontextInspector . onBrowsingContextLoaded ( ( entry ) => {
110112 navigationInfo = entry
@@ -162,7 +164,7 @@ suite(
162164 'can listen to user prompt opened event' ,
163165 async function ( ) {
164166 let userpromptOpened = null
165- const browsingcontextInspector = await BrowsingContextInspector ( driver )
167+ browsingcontextInspector = await BrowsingContextInspector ( driver )
166168
167169 const browsingContext = await BrowsingContext ( driver , {
168170 browsingContextId : await driver . getWindowHandle ( ) ,
@@ -193,7 +195,7 @@ suite(
193195 async function ( ) {
194196 const windowHandle = await driver . getWindowHandle ( )
195197 let userpromptClosed = null
196- const browsingcontextInspector = await BrowsingContextInspector ( driver , windowHandle )
198+ browsingcontextInspector = await BrowsingContextInspector ( driver , windowHandle )
197199
198200 const browsingContext = await BrowsingContext ( driver , {
199201 browsingContextId : windowHandle ,
0 commit comments