Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit d435f56

Browse files
authored
Update visual-regression.js
1 parent a07ea16 commit d435f56

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

scripts/visual-regression.js

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,54 +1358,43 @@ function debugScreenshots() {
13581358
.filter(f => f.endsWith('.png'));
13591359
console.log(` Found ${files.length} PNG files`);
13601360
console.log(` Sample:`, files.slice(0, 3));
1361-
} else {
1362-
console.log(' No data directory found');
1363-
}
1364-
1365-
console.log('\n'); 3));
1366-
} else {
1361+
} else {
13671362
console.log(' No data directory found');
13681363
}
1369-
1364+
13701365
// Try to inspect the HTML report structure
13711366
console.log('\n📄 Inspecting HTML report structure:');
13721367
const indexPath = path.join(prReportPath, 'index.html');
13731368
if (fs.existsSync(indexPath)) {
13741369
const html = fs.readFileSync(indexPath, 'utf8');
13751370
console.log(` HTML file size: ${(html.length / 1024).toFixed(1)} KB`);
1376-
1371+
13771372
// Check for various report data patterns
13781373
console.log(' Checking for report data patterns:');
13791374
console.log(` - window.playwrightReport: ${html.includes('window.playwrightReport') ? '✓' : '✗'}`);
13801375
console.log(` - window.playwrightReportBase64: ${html.includes('window.playwrightReportBase64') ? '✓' : '✗'}`);
13811376
console.log(` - __playwright_report__: ${html.includes('__playwright_report__') ? '✓' : '✗'}`);
13821377
console.log(` - data-testid="test-case-title": ${html.includes('data-testid="test-case-title"') ? '✓' : '✗'}`);
1383-
1378+
13841379
// Try to find test titles in HTML
13851380
const testTitleRegex = /data-testid="test-case-title"[^>]*>([^<]+)</gi;
13861381
const titles = [];
13871382
let titleMatch;
13881383
while ((titleMatch = testTitleRegex.exec(html)) !== null && titles.length < 5) {
13891384
titles.push(titleMatch[1].trim());
13901385
}
1391-
1386+
13921387
if (titles.length > 0) {
13931388
console.log(` Found test titles in HTML:`);
13941389
titles.forEach(title => console.log(` - "${title}"`));
13951390
}
1396-
1391+
13971392
// Save a snippet of the HTML for manual inspection
13981393
const snippet = html.substring(0, 2000);
13991394
fs.writeFileSync(path.join(ART, 'html-snippet.txt'), snippet);
14001395
console.log(` Saved HTML snippet to artifacts/html-snippet.txt for inspection`);
14011396
}
1402-
1403-
console.log('\n');
1404-
} 3));
1405-
} else {
1406-
console.log(' No data directory found');
1407-
}
1408-
1397+
14091398
console.log('\n');
14101399
}
14111400

0 commit comments

Comments
 (0)