@@ -24,9 +24,9 @@ import type { Log } from '../../packages/trace/src/har';
24
24
import { parseHar } from '../config/utils' ;
25
25
const { createHttp2Server } = require ( '../../packages/playwright-core/lib/utils' ) ;
26
26
27
- async function pageWithHar ( contextFactory : ( options ?: BrowserContextOptions ) => Promise < BrowserContext > , testInfo : any , options : { outputPath ?: string , proxy ?: BrowserContextOptions [ 'proxy' ] } & Partial < Pick < BrowserContextOptions [ 'recordHar' ] , 'content' | 'omitContent' | 'mode' > > = { } ) {
27
+ async function pageWithHar ( contextFactory : ( options ?: BrowserContextOptions ) => Promise < BrowserContext > , testInfo : any , options : { outputPath ?: string } & Partial < Pick < BrowserContextOptions [ 'recordHar' ] , 'content' | 'omitContent' | 'mode' > > = { } ) {
28
28
const harPath = testInfo . outputPath ( options . outputPath || 'test.har' ) ;
29
- const context = await contextFactory ( { recordHar : { path : harPath , ...options } , ignoreHTTPSErrors : true , proxy : options . proxy } ) ;
29
+ const context = await contextFactory ( { recordHar : { path : harPath , ...options } , ignoreHTTPSErrors : true } ) ;
30
30
const page = await context . newPage ( ) ;
31
31
return {
32
32
page,
@@ -861,38 +861,6 @@ it('should respect minimal mode for API Requests', async ({ contextFactory, serv
861
861
expect ( entry . response . bodySize ) . toBe ( - 1 ) ;
862
862
} ) ;
863
863
864
- it ( 'should include timings when using http proxy' , async ( { contextFactory, server, proxyServer } , testInfo ) => {
865
- proxyServer . forwardTo ( server . PORT , { allowConnectRequests : true } ) ;
866
- const { page, getLog } = await pageWithHar ( contextFactory , testInfo , { proxy : { server : `localhost:${ proxyServer . PORT } ` } } ) ;
867
- const response = await page . request . get ( server . EMPTY_PAGE ) ;
868
- expect ( proxyServer . connectHosts ) . toEqual ( [ `localhost:${ server . PORT } ` ] ) ;
869
- await expect ( response ) . toBeOK ( ) ;
870
- const log = await getLog ( ) ;
871
- expect ( log . entries [ 0 ] . timings . connect ) . toBeGreaterThan ( 0 ) ;
872
- } ) ;
873
-
874
- it ( 'should include timings when using socks proxy' , async ( { contextFactory, server, socksPort } , testInfo ) => {
875
- const { page, getLog } = await pageWithHar ( contextFactory , testInfo , { proxy : { server : `socks5://localhost:${ socksPort } ` } } ) ;
876
- const response = await page . request . get ( server . EMPTY_PAGE ) ;
877
- expect ( await response . text ( ) ) . toContain ( 'Served by the SOCKS proxy' ) ;
878
- await expect ( response ) . toBeOK ( ) ;
879
- const log = await getLog ( ) ;
880
- expect ( log . entries [ 0 ] . timings . connect ) . toBeGreaterThan ( 0 ) ;
881
- } ) ;
882
-
883
- it ( 'should not have connect and dns timings when socket is reused' , async ( { contextFactory, server } , testInfo ) => {
884
- const { page, getLog } = await pageWithHar ( contextFactory , testInfo ) ;
885
- await page . request . get ( server . EMPTY_PAGE ) ;
886
- await page . request . get ( server . EMPTY_PAGE ) ;
887
-
888
- const log = await getLog ( ) ;
889
- expect ( log . entries ) . toHaveLength ( 2 ) ;
890
- const request2 = log . entries [ 1 ] ;
891
- expect . soft ( request2 . timings . connect ) . toBe ( - 1 ) ;
892
- expect . soft ( request2 . timings . dns ) . toBe ( - 1 ) ;
893
- expect . soft ( request2 . timings . blocked ) . toBeGreaterThan ( 0 ) ;
894
- } ) ;
895
-
896
864
it ( 'should include redirects from API request' , async ( { contextFactory, server } , testInfo ) => {
897
865
server . setRedirect ( '/redirect-me' , '/simple.json' ) ;
898
866
const { page, getLog } = await pageWithHar ( contextFactory , testInfo ) ;
0 commit comments