Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 如何在木偶师登录后运行lighthouse主页_Reactjs_Puppeteer_Lighthouse - Fatal编程技术网

Reactjs 如何在木偶师登录后运行lighthouse主页

Reactjs 如何在木偶师登录后运行lighthouse主页,reactjs,puppeteer,lighthouse,Reactjs,Puppeteer,Lighthouse,我添加了两个npm“@lhci/cli”和puppeter。之后,我添加了两个配置文件 Lighthouse rc.js:配置详细信息如下: module.exports={ ci:{ 上传:{ 目标:“临时公共存储” }, 收集:{ 木偶脚本:“puppeter script.js”, chromePath:Puppeter.executablePath(), 网址:[”https://myWebsite.com/abc"], 真的, 跑步次数:1, disableStorageReset:

我添加了两个npm“@lhci/cli”和puppeter。之后,我添加了两个配置文件

  • Lighthouse rc.js:配置详细信息如下:
  • module.exports={
    ci:{
    上传:{
    目标:“临时公共存储”
    },
    收集:{
    木偶脚本:“puppeter script.js”,
    chromePath:Puppeter.executablePath(),
    网址:[”https://myWebsite.com/abc"],
    真的,
    跑步次数:1,
    disableStorageReset:true,
    设置:{
    disableStorageReset:true
    },
    木偶表演:{
    slowMo:20,
    无头:错,
    disableStorageReset:true
    }
    },
    断言:{
    断言:{
    'categories:performance':['warn',{minScore:1}],
    'categories:accessibility':['error',{minScore:0.5}]
    }
    }
    }
    
    };我没有关于您站点工作流的完整信息,但如Puppeter中所述,脚本将针对lhci配置文件中提到的每个url运行

    在木偶剧脚本运行之后,灯塔将打开URL。现在,如果您的站点再次打开登录页面,则很可能是您的应用程序或配置出现问题。您的应用程序未正确设置cookie,或者登录过程不知何故失败,您需要进行检查

    此外,由于配置中的每个url都将运行Puppeter脚本,如果您已经登录过一次,最好不要重新登录,请访问Github。

    您是否阅读过如何在经过身份验证的页面上使用lighthouse?