@@ -245,31 +245,32 @@ playwrightTest.describe('chromium', () => {
245
245
expect ( request . headers [ 'foo' ] ) . toBe ( 'bar' ) ;
246
246
}
247
247
} ) ;
248
- } ) ;
249
248
250
- playwrightTest ( 'should report all pages in an existing browser' , async ( { browserType, browserOptions } , testInfo ) => {
251
- const port = 9339 + testInfo . workerIndex ;
252
- const browserServer = await browserType . launch ( {
253
- ...browserOptions ,
254
- args : [ '--remote-debugging-port=' + port ]
255
- } ) ;
256
- try {
257
- const cdpBrowser = await browserType . connectOverCDP ( {
258
- endpointURL : `http://localhost:${ port } /` ,
249
+ playwrightTest ( 'should report all pages in an existing browser' , async ( { browserType, browserOptions } , testInfo ) => {
250
+ const port = 9339 + testInfo . workerIndex ;
251
+ const browserServer = await browserType . launch ( {
252
+ ...browserOptions ,
253
+ args : [ '--remote-debugging-port=' + port ]
259
254
} ) ;
260
- const contexts = cdpBrowser . contexts ( ) ;
261
- expect ( contexts . length ) . toBe ( 1 ) ;
262
- for ( let i = 0 ; i < 3 ; i ++ )
263
- await contexts [ 0 ] . newPage ( ) ;
264
- await cdpBrowser . close ( ) ;
255
+ try {
256
+ const cdpBrowser = await browserType . connectOverCDP ( {
257
+ endpointURL : `http://localhost:${ port } /` ,
258
+ } ) ;
259
+ const contexts = cdpBrowser . contexts ( ) ;
260
+ expect ( contexts . length ) . toBe ( 1 ) ;
261
+ for ( let i = 0 ; i < 3 ; i ++ )
262
+ await contexts [ 0 ] . newPage ( ) ;
263
+ await cdpBrowser . close ( ) ;
265
264
266
- const cdpBrowser2 = await browserType . connectOverCDP ( {
267
- endpointURL : `http://localhost:${ port } /` ,
268
- } ) ;
269
- expect ( cdpBrowser2 . contexts ( ) [ 0 ] . pages ( ) . length ) . toBe ( 3 ) ;
265
+ const cdpBrowser2 = await browserType . connectOverCDP ( {
266
+ endpointURL : `http://localhost:${ port } /` ,
267
+ } ) ;
268
+ expect ( cdpBrowser2 . contexts ( ) [ 0 ] . pages ( ) . length ) . toBe ( 3 ) ;
270
269
271
- await cdpBrowser2 . close ( ) ;
272
- } finally {
273
- await browserServer . close ( ) ;
274
- }
270
+ await cdpBrowser2 . close ( ) ;
271
+ } finally {
272
+ await browserServer . close ( ) ;
273
+ }
274
+ } ) ;
275
275
} ) ;
276
+
0 commit comments