lighthouse-ci
lighthouse-ci copied to clipboard
The puppeteerLaunchOptions seems not working
Describe the bug
I suspect the puppeteerLaunchOptions is not working because I passed "new" to the headless option, and I still get the headless deprecation warning. I also tried passing false to it, and getting the same warning and there was no chrome instance launched.
To Reproduce
- setting up .lighthouserc.js
module.exports = {
ci: {
collect: {
staticDistDir: "./build",
puppeteerScript: "./puppeteer-script.js",
puppeteerLaunchOptions: {
headless: false,
slowMo: 100,
},
settings: {
disableStorageReset: true,
},
numberOfRuns: 1,
},
assert: {
preset: "lighthouse:recommended",
},
},
};
And setting up puppeteer-script.js.
module.exports = async (browser, context) => {
const page = await browser.newPage();
await page.goto(context.url);
await page.waitForSelector('input[type="email"]');
await page.type('body input[type="email"]', user);
console.log("email typed");
await page.click('body input[type="submit"]');
await page.type('body input[type="password"]', pwd);
console.log("password typed");
await page.click('body input[type="submit"]');
await page.click('body input[type="submit"]');
};
Expected behavior
I'm expecting when I set the headless to be false, after run lhci collect
, a chrome browser gets launched so that I can debug the log in steps.
I am experiencing the same issue when passing { headless: "new" }
to puppeteerLaunchOptions
. The old headless deprecation warning still appears.
Same for me.
Still and issue, anyone looking at this?
it works with cli option headful
https://github.com/GoogleChrome/lighthouse-ci/blob/6914f5be825ea23e09edcd5cb46660b06dc38100/docs/configuration.md?plain=1#L206
it has preference over puppeteerLaunchOptions: https://github.com/GoogleChrome/lighthouse-ci/blob/6914f5be825ea23e09edcd5cb46660b06dc38100/packages/cli/src/collect/puppeteer-manager.js#L61-L68