mirror of
https://github.com/DeNNiiInc/Web-Page-Performance-Test.git
synced 2026-04-17 20:05:58 +00:00
Feat: Add backend support for filmstrip capture
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user