Reputation: 839
I have a file with N>10 tests defined in BDD in a feature file.
For debugging purposes, I need to execute only one of the tests many times, but I am not finding any other way than commenting out the other tests.
I am trying now to use the @focus
tag in front of the test, in a way that cypress IDE actually marks the rest of the tests as sync skip; aborting execution
, but the test that I need to run actually says No commands were issued in this test.
.
This is the example .feature file I'm playing with:
@e2eTests
@cases
Feature: Test feature
Scenario: Test 1
Given foo
When bar
Then foobar
@focus
Scenario: Test 2
Given bar
When foo
Then barfoo!
And when running npm run cypress
and selecting this feature, I get:
What am I doing wrong?
Thanks
Upvotes: 2
Views: 3063
Reputation: 1809
I would recommend using cypress-grep if you are looking for a flaky test, that needs repeating n times.
After installation and configuration (see here: Burning Tests with cypress-grep) in terminal indicate which test needs to be repeated and how many times (cypress 7.6) ->
npx cypress run --spec cypress/folder/with/test/testFile.spec.ts, --env grep="name/description of specific test", burn= >>numberOfIterations<<
Example:
npx cypress run --spec cypress/integration/testExample.spec.ts, --env grep="A popup should appear after login",burn=250
Upvotes: 1