Skip to content

Instantly share code, notes, and snippets.

@mdcruz
Created April 2, 2021 18:46
Show Gist options
  • Save mdcruz/2d786be6a708bfa57cf79ed0d3a45e2c to your computer and use it in GitHub Desktop.
Save mdcruz/2d786be6a708bfa57cf79ed0d3a45e2c to your computer and use it in GitHub Desktop.
describe('Lighthouse', () => {
it('should run performance audits using custom thresholds', () => {
cy.visit('/');
const customThresholds = {
performance: 50,
accessibility: 50,
seo: 70,
'first-contentful-paint': 2000,
'largest-contentful-paint': 3000,
'cumulative-layout-shift': 0.1,
'total-blocking-time': 500,
};
const desktopConfig = {
formFactor: 'desktop',
screenEmulation: { disabled: true },
};
cy.lighthouse(customThresholds, desktopConfig);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment