我在 chrome 浏览器中自动生成灯塔报告。但我要测试的 URL 在身份验证后面。因此,当我运行该任务时,它会为身份验证页面生成灯塔报告。如何测试实际 URL?
gulp.task("lighthouse", function () {
return launchChromeAndRunLighthouse('http://localhost:8080/Template/GetTemplate?templateName=IndexDev', flags).then(results => {
// console.log(results);
write(results, 'html', 'report.html')
});
});
function launchChromeAndRunLighthouse(url, flags) {
return chromeLauncher.launch().then(chrome => {
flags.port = chrome.port;
return lighthouse(url, flags).then();
});
}