2

我正在使用 lighthouse npm 来测试一些随机 URL ...有时它会因离开而失败

['audits']['interactive']['rawValue']

['categories']['performance']['score']

空的。

配置中有什么东西可以避免这种情况,还是“重试直到不再失败”我最好的改变。

这就是我的设置。这是木偶师+灯塔

    Start Puppeteer + open URL
    const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
    const page = await browser.newPage()
    await page.goto(urlToTest, {
        waitUntil: 'networkidle2',
        timeout: 0
    });

    //Start Lighthouse 
    let opts = {
        chromeFlags: ['--show-paint-rects'],
        output: 'html',
        throttlingMethod: 'provided',
        throttling: {   
            throughputKbps: 8000,
            downloadThroughputKbps: 8000,
            uploadThroughputKbps: 2000
        }
    };

    opts.port = (new URL(browser.wsEndpoint())).port;
    let lighthouseResults = await lighthouse(urlToTest, opts, config = null);
4

0 回答 0