11const fs = require ( 'fs' ) ;
22const path = require ( 'path' ) ;
33
4- / **
4+ /********************************************************* **
55 * Fixes HTML-encoded video paths in the Mochawesome report
66 * The video path is embedded as escaped JSON in the HTML
7- */
7+ ************************************************************ /
88
99const reportPath = path . join ( __dirname , '../cypress/reports/html/cypress-cucumber-poc-results.html' ) ;
1010
@@ -91,7 +91,7 @@ function fixHtmlEncodedVideo() {
9191 if ( htmlContent === originalContent ) {
9292 console . log ( '⚠ No video paths found to fix\n' ) ;
9393
94- // Debug: Show what we found
94+ // Debug: Show video-related strings found
9595 console . log ( 'Debug info:' ) ;
9696 const anyVideo = htmlContent . match ( / v i d e o s [ ^ " ' \s ] { 0 , 100 } / g) ;
9797 if ( anyVideo ) {
@@ -102,14 +102,14 @@ function fixHtmlEncodedVideo() {
102102 return ;
103103 }
104104
105- // Write the fixed HTML
105+ // Write the fixed HTML to update the report
106106 fs . writeFileSync ( reportPath , htmlContent , 'utf8' ) ;
107107
108108 const changeCount = ( originalContent . length - htmlContent . length ) ;
109109 console . log ( `✅ Successfully updated report!` ) ;
110110 console . log ( ` Bytes changed: ${ Math . abs ( changeCount ) } ` ) ;
111111
112- // Verify
112+ // Verify the report content after the fix to ensure no nested paths remain
113113 const verifyContent = fs . readFileSync ( reportPath , 'utf8' ) ;
114114 const stillHasBadPath = verifyContent . includes ( 'videos/cypress/e2e/' ) ;
115115
0 commit comments