File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change 11const puppeteer = require ( 'puppeteer' ) ;
22
33function delay ( time ) {
4- return new Promise ( function ( resolve ) {
4+ return new Promise ( function ( resolve ) {
55 setTimeout ( resolve , time )
66 } ) ;
7- }
7+ }
88
99( async ( ) => {
10- const browser = await puppeteer . launch ( {
11- executablePath : process . env . PUPPETEER_EXEC_PATH , // set by docker container
12- headless : true ,
13- args : [ '--no-sandbox' , '--disable-setuid-sandbox' ] ,
14- slowMo : 50
10+ const browser = await puppeteer . launch ( {
11+ executablePath : process . env . PUPPETEER_EXEC_PATH , // set by docker container
12+ headless : true ,
13+ args : [ '--no-sandbox' , '--disable-setuid-sandbox' ] ,
14+ slowMo : 50
1515 } ) ;
16-
17- const page = await browser . newPage ( ) ;
18- await page . goto ( 'http://localhost:5173/react-pipeline/' ) ;
19- await delay ( 2000 ) ;
20- await page . screenshot ( { path : 'homepage.png' } ) ;
2116
22- await browser . close ( ) ;
17+ const page = await browser . newPage ( ) ;
18+ await page . goto ( 'http://localhost:5173/react-pipeline/' ) ;
19+ await delay ( 2000 ) ;
20+ await page . screenshot ( { path : 'homepage.png' } ) ;
21+
22+ await browser . close ( ) ;
2323} ) ( ) ;
You can’t perform that action at this time.
0 commit comments