Lighthouse: AMP and PWA how to run separate tests?

Created on 25 Jan 2017  ·  7Comments  ·  Source: GoogleChrome/lighthouse

Hi,

I have a PWA website for desktop and tablets and AMP-HTML for Mobile.

When I run the Chrome extension test and put in the Desktop URI, lighthouse loads my amp-html URI every time.

Is there an option to force lighthouse to run the test for PWA and then do another test to run for AMP-HTML.

(sorry just started using lighthouse 5 minutes ago, so maybe I asking a stupid question?)

needs-priority question

Most helpful comment

@paulirish @brendankenny have we talked about being able to customize the emulation settings before running the extension? Seems like a good option to support.

All 7 comments

The extension loads the page using mobile device emulation. It sounds like it's triggering the mobile version of your site, which is AMP and different than desktop? Is that right?

Unfortunately, there's not a way to turn off emulation in the extension...but the Node CLI has flags to disable device emulation and network throttling. You can use that to "force" the desktop version of your site.

https://github.com/GoogleChrome/lighthouse#lighthouse-cli-options

@ebidel Thank you for your reply, I was also thinking it was a mobile user-agent that was causing the problem. Will try out the cli version and give it a go...

Not sure if the lighthouse team want to add it as a feature update to their Chrome Plugin but an option to change the device emulation and network throttling would be a useful update.

p.s. Will leave this to the owners of this github to close this issue or not?

@paulirish @brendankenny have we talked about being able to customize the emulation settings before running the extension? Seems like a good option to support.

To chime in a 👍 here –

Since https://github.com/GoogleChrome/lighthouse/pull/1761 added --chrome-flags a cornucopia of configuration options have opened up, one being Chrome's --user-agent flag.

Enabling emulation mode overrides any User Agent passed in via this Chrome flag:

I would like to set the User Agent to enable particular backend behaviour.

In our case, including a special constant in the User Agent enables particular behaviour we're looking to test.

Right now it isn't possible to provide this special User Agent and use mobile emulation without forking and manually altering the value of NEXUS5X_USERAGENT.

@ebidel For someone that wants to audit a web app, how can I do this reliably? It's only for desktop, and requires authentication with a third party. It seems like it would be quite complicated for something like this, which can already be simulated on mobile from the browser.

duping into #2838

we will introduce ability to run under desktop profile real soon now. :)

Was this page helpful?
0 / 5 - 0 ratings