Tests are way too slow when this preprocessor is used
See original GitHub issueTried a simple button test
- button.spec.ts - finishes in
4s - button.feature - finishes in
40s
button.spec.ts
describe('Button - vanilla', () => {
it('should launch button page', () => {
cy.visit('/components/ui/button');
cy.contains('Examples').click();
cy.contains('Secondary Buttons').click();
cy.get('#button-secondary').should('be.visible');
});
});
button.feature
Feature: Button
TRQ-XXXXX
Background:
Given button page is open
Scenario: Default Button
When I click on examples tab
And I click on secondary-buttons example
Then I should see secondary button
button.steps.ts
import { Given, When, And, Then } from 'cypress-cucumber-preprocessor/steps';
Given(`button page is open`, () => {
cy.visit('/components/ui/button');
});
When(`I click on examples tab`, () => {
cy.contains('Examples').click();
});
And(`I click on secondary-buttons example`, () => {
cy.contains('Secondary Buttons').click();
});
Then(`I should see secondary button`, () => {
cy.get('#button-secondary').should('be.visible');
});
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Tests are way too slow when this preprocessor is used #336
Tried a simple button test button.spec.ts - finishes in 4s button.feature ... Tests are way too slow when this preprocessor is used #336....
Read more >9 Ways To Make Slow Tests Faster - Semaphore CI
Making slow tests fast again Here are the nine most common performance problems and their solutions: My tests are too large: break them...
Read more >Angular 4 Unit Tests (TestBed) extremely slow - Stack Overflow
There I use fixture.detectChanges() only when I need to check/test the changed values, but the test take 15 seconds to run (on avarage...
Read more >c++ - Do preprocessor defines slow down build times?
It seems like the build time would be faster if the preprocessor didn't need to scan and replace the defines for files that...
Read more >How to preprocess Cypress tests with Vite - Adam Lynch
The preprocessor hook I'll be using isn't supported for component tests. However, the Cypress team have created a @cypress/vite-dev-server ...
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 Free
Top 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

Hi! Are there any news on this? We recently migrated from stock Cypress Mocha to cucumber using the preprocessor and the Suite of 10 somewhat long tests we have currently is taking double the time it used to with Mocha.
We’re using Cypress 7.5.0 and cypress-cucumber-preprocessor 4.1.2.
Things we already tried…
Thanks!!
I did some investigating myself and unfortunately found no performance overhead associated with using the preprocessor (note: using latest version, see https://github.com/badeball/cypress-cucumber-preprocessor/issues/689). I took one of the tests that are auto-generated when opening Cypress for the first time, duplicated and re-wrote it using steps. This can be found at badeball/cypress-cucumber-performance-comparison. Then I ran everything ten times. Below are the results.
As you can see, there was little to no difference.
Unless anyone can show me otherwise, I’m considering this a non-issue. That’s not so say that you’re not experiencing any issues, but I can’t investigate and fix something that I can’t observe myself.