cypress-io / cypress-grep

Filter tests using substring
137 stars 19 forks source link

Hmm, wrong number of tests execute #59

Closed bahmutov closed 3 years ago

bahmutov commented 3 years ago

When using from the console Cypress.grep(..., null, 5) it executes 25 tests, seems there is double loop somewhere

Screen Shot 2021-07-29 at 11 06 41
bahmutov commented 3 years ago

Same from the command line

$ npx cypress run --env grep='completes second item',burn=5
cypress-grep: tests with "completes second item" in their names
cypress-grep: running filtered tests 5 times
...
- works
  ✓ completes second item: burning 1 of 5: burning 1 of 5 (1677ms)
  ✓ completes second item: burning 1 of 5: burning 2 of 5 (1231ms)
  ✓ completes second item: burning 1 of 5: burning 3 of 5 (1213ms)
  ✓ completes second item: burning 1 of 5: burning 4 of 5 (1208ms)
  ✓ completes second item: burning 1 of 5: burning 5 of 5 (1212ms)
  ✓ completes second item: burning 2 of 5: burning 1 of 5 (1207ms)
  ✓ completes second item: burning 2 of 5: burning 2 of 5 (1202ms)
  ✓ completes second item: burning 2 of 5: burning 3 of 5 (1202ms)
  ✓ completes second item: burning 2 of 5: burning 4 of 5 (1196ms)
  ✓ completes second item: burning 2 of 5: burning 5 of 5 (1206ms)
  ✓ completes second item: burning 3 of 5: burning 1 of 5 (1195ms)
  ✓ completes second item: burning 3 of 5: burning 2 of 5 (1193ms)
  ✓ completes second item: burning 3 of 5: burning 3 of 5 (1196ms)
  ✓ completes second item: burning 3 of 5: burning 4 of 5 (1205ms)
  ✓ completes second item: burning 3 of 5: burning 5 of 5 (1195ms)
...
bahmutov commented 3 years ago

Turns out I had cypress-grep initialization in both the support and in the spec files, leading to double plugin

// load and register the grep feature
// https://github.com/bahmutov/cypress-grep
require('cypress-grep')()
github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 2.5.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: