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

Use finalDisplayedUrl to identify reports #887

Open
chaimabg opened this issue Mar 16, 2023 · 6 comments · May be fixed by #901
Open

Use finalDisplayedUrl to identify reports #887

chaimabg opened this issue Mar 16, 2023 · 6 comments · May be fixed by #901
Assignees
Labels

Comments

@chaimabg
Copy link

Describe the bug
I am running lighthouse-ci on two different URLs ( 'https://localhost:3000/Portal/#/Login' & 'https://localhost:3000/Portal/#/Dashboard') . The two generated reports (json file in .lighthouseci folder) have the same final URL ('https://localhost:3000/Portal/'). Only one report is showed on Lighthouse server (for this URL: 'https://localhost:3000/Portal/').

Expected behavior
Final URL and requested URL should have the same value.
Two reports are showed on lighthouse server ('https://localhost:3000/Portal/#/Login' & 'https://localhost:3000/Portal/#/Dashboard').

Configuration file

module.exports = {
    ci: {
        collect: {
            headful: true, 
            url:  [
                'https://localhost:3000/Portal/#/Login',
                'https://localhost:3000/Portal/#/Dashboard',
          ],
           puppeteerScript: 'authScript.js',  // Ensure there's an authenticated user before running Lighthouse for the second url
           puppeteerLaunchOptions: {
                defaultViewport: null,
            },
            numberOfRuns: 1, 
            settings: {
                disableStorageReset: true,
                preset: 'desktop',
                onlyCategories: ['performance'],
            }
        },
        upload: {
            target: 'lhci',
            serverBaseUrl: 'http://127.0.0.1:9001/',
            token: 'token', // the build token provider by the wizard. 
        }
    }
}

Reports

{
  "lighthouseVersion": "9.6.8",
  "requestedUrl": "https://localhost:3000/Portal/#/Login",
  "finalUrl": "https://localhost:3000/Portal/",
  "fetchTime": "2023-03-16T15:25:31.825Z",
  "gatherMode": "navigation",
  "runWarnings": [
    "The page may not be loading as expected because your test URL (https://localhost:3000/Portal/#/Login) was redirected to https://localhost:3000/Portal/. Try testing the second URL directly."
  ],...
}
{
  "lighthouseVersion": "9.6.8",
  "requestedUrl": "https://localhost:3000/Portal/#/Dashboard",
  "finalUrl": "ttps://localhost:3000/Portal/",
  "fetchTime": "2023-03-16T15:26:03.752Z",
  "gatherMode": "navigation",
  "runWarnings": [],...
}

Lighthouse Version
9.6.8

Environment (please complete the following information):

  • Browser : chrome (Version 111.0.5563.65)
@vilanint7
Copy link

@chaimabg , have you tried using the urlreplacementpatterns, https://github.com/GoogleChrome/lighthouse-ci/blob/75f4bb8f66d5042989f3882683c0e843677dda06/docs/configuration.md#urlreplacementpatterns

I have a similar problem and was planning to use urlreplacementpatterns

@chaimabg
Copy link
Author

@vilanint7, yes I have tried to use urlreplacementpatterns but didn't work for my case. This problem is fixed with lighthouse version 10.0.2 but unfortunately lighthouse-ci works only with the version 9.6.8

@vilanint7
Copy link

vilanint7 commented Mar 26, 2023

Thanks @chaimabg do you get an error when lighthouse version is higher? What is the error you get?

Below are my versions

lhci --version
0.8.2
lighthouse --version
7.4.0

Based on the dockerfile it looks like higher version of lighthouse should be supported
https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/recipes/docker-client/Dockerfile#L17

there seems to be a related pr
#890

@chaimabg
Copy link
Author

@vilanint7, no I don't get an error when lighthouse version is higher.
I'm using the latest version of lhci (0.11.0) but doesn't support lighthouse version 10.0.2.

@adamraine adamraine changed the title Getting the same final URL in the generated reports for two different URLs Use finalDisplayedUrl to identify reports Apr 17, 2023
@adamraine
Copy link
Member

As proposed in #900 the solution here is to use finalDisplayedUrl to identify reports. This cannot be backported for reports generated by Lighthouse version below 10.0.

@adamraine adamraine added the P1 label Apr 17, 2023
@adamraine adamraine self-assigned this Apr 17, 2023
@adamraine adamraine linked a pull request Apr 17, 2023 that will close this issue
@tiagomrm
Copy link

Any news on this issue? Did you find a workaround?

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

Successfully merging a pull request may close this issue.

4 participants