File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ jobs:
167167 if : ${{ always() }}
168168 with :
169169 name : screenshots-${{matrix.scenario}}
170- path : ./ci/tests/puppeteer/screenshots/*.png
170+ path : ./ci/tests/puppeteer/screenshots/*.*
171171 if-no-files-found : ignore
172172 retention-days : 2
173173 # #########################################################################
@@ -222,7 +222,7 @@ jobs:
222222 if : ${{ always() }}
223223 with :
224224 name : screenshots-${{matrix.scenario}}
225- path : ./ci/tests/puppeteer/screenshots/*.png
225+ path : ./ci/tests/puppeteer/screenshots/*.*
226226 if-no-files-found : ignore
227227 retention-days : 2
228228# #########################################################################
@@ -277,7 +277,7 @@ jobs:
277277 if : ${{ always() }}
278278 with :
279279 name : screenshots-${{matrix.scenario}}
280- path : ./ci/tests/puppeteer/screenshots/*.png
280+ path : ./ci/tests/puppeteer/screenshots/*.*
281281 if-no-files-found : ignore
282282 retention-days : 2
283283# #########################################################################
Original file line number Diff line number Diff line change @@ -892,6 +892,21 @@ exports.screenshot = async (page) => {
892892 }
893893} ;
894894
895+ exports . recordPage = async ( page ) => {
896+ const screenshotsDir = path . join ( __dirname , "screenshots" ) ;
897+ if ( ! fs . existsSync ( screenshotsDir ) ) {
898+ fs . mkdirSync ( screenshotsDir ) ;
899+ await this . log ( `Created screenshots directory: ${ screenshotsDir } ` ) ;
900+ }
901+ const index = Date . now ( ) ;
902+ const filePath = path . join ( screenshotsDir , `${ process . env . SCENARIO } -${ index } .mp4` ) ;
903+ await this . logg ( `Recording page at ${ filePath } ` ) ;
904+ return page . screencast ( {
905+ path : filePath ,
906+ format : "mp4"
907+ } ) ;
908+ } ;
909+
895910exports . isCiEnvironment = async ( ) => process . env . CI !== undefined && process . env . CI === "true" ;
896911
897912exports . isNotCiEnvironment = async ( ) => ! this . isCiEnvironment ( ) ;
You can’t perform that action at this time.
0 commit comments