我正在chrome浏览器中自动化灯塔报告。 但是我要测试的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();
});
}