File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,14 @@ const baseURL = process.env.BASE_URL ? process.env.BASE_URL : 'http://127.0.0.1:
2424// runs
2525const runs = process . env . RUNS ? parseInt ( process . env . RUNS ) : 100 ;
2626
27- const executablePath = process . env . CHROME_PATH ? process . env . CHROME_PATH : '/usr/bin/google-chrome' ;
28-
2927// measure general time.
3028const gstart = process . hrtime . bigint ( ) ;
3129// store all run durations
3230let metrics = [ ] ;
3331
3432( async ( ) => {
35- // Launch the browser and open a new blank page
36- const browser = await puppeteer . launch ( {
37- executablePath : executablePath ,
33+ // Connect to the browser and open a new blank page
34+ const browser = await puppeteer . connect ( {
3835 browserURL : browserAddress ,
3936 } ) ;
4037
@@ -101,7 +98,7 @@ let metrics = [];
10198 metrics [ run ] = process . hrtime . bigint ( ) - rstart ;
10299 }
103100
104- await browser . close ( ) ;
101+ await browser . disconnect ( ) ;
105102
106103 const gduration = process . hrtime . bigint ( ) - gstart ;
107104
You can’t perform that action at this time.
0 commit comments