mfrachet / cypress-audit

⚡ Run Lighthouse and Pa11y audits directly in your E2E test suites
https://mfrachet.github.io/cypress-audit/
MIT License
352 stars 43 forks source link

Showing HTTP/1.1 in the report while running with Cypress #150

Closed emperol2 closed 2 years ago

emperol2 commented 2 years ago

Before creating an issue, make sure to have setup the projects with the 3 steps provided in the README. You can also verify the examples folder and check if there is already an application using a similar setup to yours.

What does not work? A clear and concise description of what the bug is.

I have a very simple test here running against Google website.

it('test', () => {
    cy.visit('https://www.google.com')
    cy.lighthouse(
        {
            performance: 60,
            accessibility: 90,
            'best-practices': 80,
            seo: 80,
        },
        {
            formFactor: 'desktop',
            screenEmulation: {
                mobile: false,
                disable: false,
                width: 1350,
                height: 940,
                deviceScaleRatio: 1,
            },
            output: "html",
            throttling: {
                rttMs: 40,
                throughputKbps: 11024,
                cpuSlowdownMultiplier: 1,
                requestLatencyMs: 0,
                downloadThroughputKbps: 0,
                uploadThroughputKbps: 0,
            },
            throttlingMethod: "simulate",
        },
    )
});

However, the report presented this saying the use of HTTP/1.1 while Cypress opened the new browser tab.

Screen Shot 2565-04-25 at 13 39 18

How to reproduce? Steps to reproduce the behavior. A Github repository reproducing the error is very welcome.

As mentioned above by running Cypress Open Runner or Cypress headless

Expected behavior A clear and concise description of what you expected to happen.

The report should show the HTTP/2 instead of HTTP/1.1

Screenshots / Animated Gifs Add screenshots or screen recordings to help explain your problem.

Environment (please complete the following information):

Any other information that may help fixing the issue? Add any other context about the problem here.

I am not really sure if this is the bug. However, I tried to look at many threads but I can't figure out this.

mfrachet commented 2 years ago

The tool is running the regular lighthouse package under the hood. I don't have control over what the tool is providing. When getting back from holidays, I'll take care of updating the underlying lighthouse library, maybe a fix has been applied in the meantime 🤷🏻

mfrachet commented 2 years ago

I've bumped and merged the underlying lighthouse library. I'm going to close this issue since I can't do more about it. I hope it will help you 🤞🏻

https://github.com/mfrachet/cypress-audit/pull/170