Slow assertion of a table
See original GitHub issueCurrent 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:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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