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

FID & INP calculation in journeys with cy.startVitalsCapture() & cy.reportVitals() not working #34

Open
patrjst opened this issue Jan 31, 2024 · 1 comment

Comments

@patrjst
Copy link

patrjst commented Jan 31, 2024

Issue

Setup:

  • node version: tested with 16, 18, 20
  • cypress-web-vitals version: 4.1.2

Details

Starting with this example
https://github.com/cmorten/cypress-web-vitals/blob/main/examples/13.x/cypress/e2e/journey.cy.js

and also creating more complex flows with many clicks I'm not able to retrieve the calculated metrics for Core Web Vitals FID and INP while the journey is successful and can be also observed as doing, what it should do in the cypress browser view.

For the example I get not even anything:

log-------- cy.vitals() --------
14
loglcp web-vital could not be calculated, and threshold was 2500. Skipping...
15
logfid web-vital could not be calculated, and threshold was 100. Skipping...
16
logcls web-vital could not be calculated, and threshold was 0.1. Skipping...
logfcp web-vital could not be calculated, and threshold was 1800. Skipping...
18
logttfb web-vital could not be calculated, and threshold was 600. Skipping...
19
loginp web-vital could not be calculated, and threshold was 500. Skipping...
20
log-----------------------------

For other scenarios I get at least other metrics while FID and INP cannot be calculated:

log-------- cy.vitals() --------
77
loglcp web-vital is 595.2000000029802, and threshold was 2500. Pass.
78
logfid web-vital could not be calculated, and threshold was 100. Skipping...
79
logcls web-vital is 0.6627196228997799, and is over the 0.1 threshold. Fail.
80
logfcp web-vital is 561.8999999910593, and threshold was 1800. Pass.
81
logttfb web-vital is 38.599999994039536, and threshold was 600. Pass.
82
loginp web-vital could not be calculated, and threshold was 200. Skipping...
83
log-----------------------------

Tested via npx cypress open and npx cypress run --browser chrome --specs ...

If I use cy.vitals() + providing some valid elements in firstInputSelector, it can calculate both FID & INP. Looks like that there is not too much necessary to create sufficient interaction.

Maybe If I will be able to retrieve metrics for the example
https://github.com/cmorten/cypress-web-vitals/blob/main/examples/13.x/cypress/e2e/journey.cy.js
I can adapt other tests?

Thank you!

@cmorten
Copy link
Owner

cmorten commented Feb 11, 2024

Hey @patrjst 👋

Are you able to provide a test code example where this happens?

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

No branches or pull requests

2 participants