Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get user data directory working together with puppeteer script #1012

Open
ghost opened this issue Feb 13, 2024 · 0 comments
Open

Comments

@ghost
Copy link

ghost commented Feb 13, 2024

Using "lhci autorun" in Azure Devops pipeline against authenticated site using a lighthouserc.json for configuration and a puppeteer script that successfully logs in to my site. In the puppeteer script I have set a specific userDataDir that is successfully created, called "puppDataDir".
But I am unable to get the following lighthouse process to use that user directory. Instead I'm being redirected to my login page and that is analyzed instead.

If I use a script for the entire process, hence puppeteering into the page and then using lighthouse programmatically, then the analysis is run correctly, but I want to be able to upload to CI server, and this is so smooth using the autorun.

So, is it a bug or me doing something wrong or is this not even a supported use case?

Expected behavior
Running lhci autorun with a selected user-data-dir should pick up the authenticated session from puppeteer.

My json config looks like this, but note that I have also tried setting chromeFlags user-data-dir, but then getting warning that it is not used when having puppeteerScript set.:
{ "ci": { "collect": { "puppeteerScript": "./lh-runner.js", "puppeteerLaunchOptions": { "args": [ "'--user-data-dir=puppDataDir'" ] }, "chromePath": false, "numberOfRuns": 1, "disableStorageReset": true, "url": [ "XXX" ], "ignoreDuplicateBuildFailure": true, "emulatedFormFactor": "desktop", "screenEmulation": "desktop", "emulatedUserAgent": "desktop", "output": [ "html" ] }, "upload": { "target": "lhci", "serverBaseUrl": "XXXX", "token": "XXXXX", "ignoreDuplicateBuildFailure": true } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants