Im using cypress to test a website, I need a way to measure the amount of time that it takes to load or execute certain cypress commands. For example:
//var startTime = SomeStopwatchFunction();
cy.visit("/a website");
cy.get("Some item");
//cy.log(SomeStopwatchFunction - startTime);
I've tried using the cy.clock()
but that returns 0. So I might be doing something wrong there. I've used performance.now()
which kinda works but always returns the same value regardless of the load time. I've used Date.getTime()
but that also returns 0. Its got to have something to do with how cypress executes the code but nothing seems to work.