My current challenge involves using cypress to carry out website tests. I am looking for a reliable method to measure the duration it takes for certain cypress commands to load or execute. As an example:
//var startTime = SomeStopwatchFunction();
cy.visit("/a website");
cy.get("Some item");
//cy.log(SomeStopwatchFunction - startTime);
I attempted to utilize cy.clock()
, but it consistently returns 0, indicating that I may be making a mistake there. While performance.now()
seemed somewhat effective, it always yields the same value regardless of the loading time. Additionally, Date.getTime()
also provides me with 0. The issue likely stems from how cypress executes the code, as none of these methods seem to deliver the desired outcome.