-
-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Have you read the documentation?
- Yes, I've read the how to make a reproducable bug guide
- Yes, I've read the how to debug my script guide
URL
https://youtrack.jetbrains.com
What are you trying to accomplish
Summary
sitespeedio/sitespeed.io:37.5.1-plus1
Steps
I read the docs about the param:
--browsertime.script, --script Add custom Javascript that collect metrics and run after the page has finished loading. Note that --script can be passed multiple times if you want to collect multiple metrics. The metrics will automatically be pushed to the summary/detailed summary and each individual page + sent to Graphite
and created a file /metrics.js with the content:
return (function() {
console.log("metrics.js");
try {
const entries = performance.getEntriesByType("navigation");
const entry = entries[0];
console.log(`metrics.js: entry: ${entry}`);
console.log(`metrics.js: entries: ${entries}`);
} catch (e) {}
})();and passes a view params to the test:
--browsertime.script /metrics.js
Actual result
I see metrics.js messages before the test, but not after the page has finished loading
Expected result
I will see metrics.js messages after the page has finished loading, or I will see an actual documentations about how to add custom measurements
What browser did you use?
Chrome
How to reproduce
--browsertime.script /metrics.jsLog output
STDOUT: Chromium 136.0.7103.25
STDOUT: Mozilla Firefox 136.0.4
STDOUT: Architecture: aarch64
STDOUT: [2025-05-30 15:10:59] INFO: Versions OS: linux 6.10.14-linuxkit nodejs: v22.13.0 sitespeed.io: 37.5.1 browsertime: 24.6.0 coach: 8.1.1
STDOUT: [2025-05-30 15:10:59] INFO: The following plugins are enabled: assets, browsertime, budget, coach, domains, harstorer, html, lateststorer, metrics, pagexray, remove, text, thirdparty
STDOUT: metrics.js
STDOUT: metrics.js: entry: undefined
STDOUT: metrics.js: entries:
STDOUT: [2025-05-30 15:10:59] INFO: Running tests using Chrome - 1 iteration(s)
STDOUT: [2025-05-30 15:11:00] INFO: Testing url https://youtrack.jetbrains.com/ iteration 1
STDOUT: [2025-05-30 15:11:11] INFO: Take after page complete check screenshot