Feat: Add backend support for filmstrip capture

This commit is contained in:
2025-12-28 05:08:12 +11:00
parent d345694b01
commit 50dcf9b498
2 changed files with 22 additions and 5 deletions

View File

@@ -60,6 +60,7 @@ async function _executeTest(url, options) {
const { v4: uuidv4 } = await import('uuid');
const isMobile = options.isMobile ?? false; // Default to desktop (matches frontend)
const captureFilmstrip = options.captureFilmstrip ?? false;
const reportDir = path.join(__dirname, '..', 'reports');
// Ensure reports directory exists
@@ -111,7 +112,21 @@ async function _executeTest(url, options) {
},
throttlingMethod: 'provided'
},
passes: [{
passName: 'defaultPass',
recordTrace: true, // Required for filmstrip
useThrottling: true,
pauseAfterFcpMs: 0,
pauseAfterLoadMs: 0,
networkQuietThresholdMs: 0,
cpuQuietThresholdMs: 0,
gatherers: []
}]
};
if (!captureFilmstrip) {
config.settings.skipAudits = ['screenshot-thumbnails', 'final-screenshot'];
}
const runnerOptions = {
logLevel: 'info',
@@ -148,7 +163,9 @@ async function _executeTest(url, options) {
tbt: lhr.audits['total-blocking-time'].numericValue,
},
userAgent: lhr.userAgent,
isMobile: isMobile
isMobile: isMobile,
filmstrip: captureFilmstrip ? (lhr.audits['screenshot-thumbnails']?.details?.items || []) : []
};
};
// Save JSON Summary