Skip to content

Commit f540569

Browse files
committed
Commenting updates in cypress.config.js and fix-html-encoded-video.js
1 parent e588701 commit f540569

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

cypress.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = defineConfig({
3333
on('after:run', async (results) => {
3434
console.log('\n📹 Post-processing video paths in report...');
3535

36-
// Add a small delay to ensure report is fully written
36+
// Delay to ensure the report is fully written
3737
await new Promise(resolve => setTimeout(resolve, 2000));
3838

3939
try {
@@ -51,11 +51,12 @@ module.exports = defineConfig({
5151
screenshotOnRunFailure: true,
5252
experimentalStudio: true,
5353
experimentalWebKitSupport: true,
54+
// ***************************************************************************
5455
// Retry enabled globally - to retry all failing tests
5556
// Disable this and move to individual test or specs to enable retry per
5657
// test or a spec only. This will retry a failed test (1 retry) when it fails
5758
// NOTE: Increase runMode int to increase test retries
58-
// *************************************************************************
59+
// ***************************************************************************
5960
retries: {
6061
"runMode": 1, // Increase to attempt retries for failed tests
6162
"openMode": 0

scripts/fix-html-encoded-video.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const fs = require('fs');
22
const 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

99
const 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(/videos[^"'\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

Comments
 (0)