Skip to content

Commit

Permalink
ci: 0.1 cumulative layout shift for headless ssr sample tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprudhomme committed Nov 26, 2024
1 parent 4fa3ba1 commit 36d620c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/prbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ jobs:
- 'e2e-atomic-vuejs-test'
- 'e2e-atomic-stencil-test'
- 'e2e-atomic-insight-panel-test'
- 'e2e-headless-ssr-test-app-dev'
- 'e2e-headless-ssr-test-app-prod'
- 'e2e-headless-ssr-test-pages-dev'
- 'e2e-headless-ssr-test-pages-prod'
runs-on: ubuntu-latest
steps:
- name: Harden Runner
Expand Down
20 changes: 8 additions & 12 deletions packages/samples/headless-ssr/cypress/e2e/smoke.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,25 @@ const resultListSelector = '.result-list li';
const searchBoxSelector = '.search-box input';
const routes = ['generic?tab=all', 'react?tab=all'] as const;

const isPageDev =
process.env.NODE_ENV === 'development' &&
Cypress.env('NEXTJS_ROUTER') === 'pages';

// Note: Thresholds might need to be adjusted as the page tested changes (e.g. more components are added etc)
const vitals: Record<(typeof routes)[number], Cypress.ReportWebVitalsConfig> = {
'generic?tab=all': {
thresholds: {
fcp: isPageDev ? 2000 : 200,
lcp: isPageDev ? 2000 : 200,
cls: 0,
ttfb: 60,
lcp: 2500,
fid: 400,
cls: 0.1,
fcp: 1800,
ttfb: 600,
inp: 400,
},
},
'react?tab=all': {
thresholds: {
fcp: isPageDev ? 2000 : 400,
lcp: isPageDev ? 2000 : 400,
cls: 0,
ttfb: 120,
lcp: 2500,
fid: 800,
cls: 0.1,
fcp: 1800,
ttfb: 600,
inp: 800,
},
},
Expand Down

0 comments on commit 36d620c

Please sign in to comment.