question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slow assertion of a table

See original GitHub issue

Current behavior:

My Angular application displays some movies in a table which I assert using Cypress. My 20 row table takes 15 seconds to assert on my machine. You’ll see Cypress basically hang and then resolve everything all at once. Asserting 40 rows takes 50 seconds, so performance seems to deteriorate exponentially.

Desired behavior:

I’m sure Cypress should be able to do this more quickly. If it’s a programming error, I’d be interested to know what it is. I’m using aliases and a nested for loop.

Test code to reproduce

Use this repo to reproduce. npm run e2e -- --watch to start Cypress, then click movies.feature. The assertion code can be found here. Worth noting I had a similar algorithm using then, which was almost equally slow.

Versions

Windows 10
Chrome 80

"cypress": "^4.4.0",
"cypress-cucumber-preprocessor": "^2.3.0",

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bahmutovcommented, Apr 21, 2020

You can avoid using aliases and get much faster speed, see PR example https://github.com/cypress-io/cypress-example-recipes/pull/487

If the table has “settled” and the individual values are not going to change, no need to access every cell individually

1reaction
jennifer-shehanecommented, Apr 22, 2020

I’m going to close this issue since you have a better workaround - particularly since the gist of the performance optimizations for Cypress are described in #6967

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validate tables with assertions | Dataform - Google Cloud
The assertion fails if there is more than one row in the table with the same values for all the specified columns.
Read more >
Does a type assertion / type switch have bad performance / is ...
@Ainar-G nothing in particular. I just want to know if type assertion performance is as bad as casting in C/C++ or other similar...
Read more >
Assertion Tables - Defense Acquisition University
This video discusses assertion tables, which requires contractors to identify any noncommercial data (i.e. technical data and computer software) to be ...
Read more >
Assertion : When a sphere is rolls on a horizontal table it slows ...
Assertion : When a sphere is rolls on a horizontal table it slows down and eventually stops. Reason : When the sphere rolls...
Read more >
9 Ways To Make Slow Tests Faster - Semaphore CI
So, they set a fixed timer that made the test work. Sleep statements are usually found between a function call and it's verifying...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found