Is common to cypress take so much time to visit some page in nuxt project?

Viewed 2752

Overview

In my project, Cypress is taking over 15s to visit a Nuxt page and then run the test

The test is running quickly, but it takes a long time to load the page.

What can I do to reduce the visit time?

What I'm trying to do?

I want to run my e2e tests in local mode with MirageJS and in CircleCI too to validate my PRs

Details

Cypress version: 7.4.0

3 Answers

I very much agree with the comment that say you need to share more context with us.

However, to give you some pointers where to start:

  • understand the application, what get loaded when you visit a new page, look at network requests
  • does this happen only in Cypress or even when you visit a page?
  • be aware of what you're testing and block everything else; Cypress has blockHosts configuration that can block certain requests, which in turn can significantly speed up execution; an example comes to mind: you don't need to see some ads or pictures when testing with Cypress, then you can block these requests and make your execution faster
  • you can increase timeouts, which won't help you speed your test suites, but at least they might not fail next time

My teams project is NUXT based and I had trouble with render time on all versions from 5.2 to 6.8 too. Since then I made the following configuration in cypress.json file for increasing the default wait time:

{
  "requestTimeout": 60000,
  "responseTimeout": 60000
}
Related