Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steps counter show wrong values #1579

Closed
Florent-Bouisset opened this issue Feb 15, 2021 · 4 comments · Fixed by #1669
Closed

Steps counter show wrong values #1579

Florent-Bouisset opened this issue Feb 15, 2021 · 4 comments · Fixed by #1669
Assignees
Labels
🐛 bug Defect / Bug

Comments

@Florent-Bouisset
Copy link

Florent-Bouisset commented Feb 15, 2021

Hello, since I upgrade to v7 I have this issue (that I didn't have in v5.1):

The counter on the progress bar when using in combinaison with tags show erroneous max value, and the progress-bar size is also not adapted.

Step to reproduce:
By your own:
Run cucumber-js with options: --format progress-bar --tags <tag>

Minimal reproducible example:
https://github.com/Florent-Bouisset/bug-reproduce-cucumber/

npm run test

Expected result:
When the test is over the progress bar should show 5/5

Actual result:
When the test is over the progress bar show 5/15
15 is the number of step it should have done without the --tag option.

image

@davidjgoss davidjgoss added the 🐛 bug Defect / Bug label Feb 19, 2021
@davidjgoss
Copy link
Contributor

Thanks for the clear repro @Florent-Bouisset, we'll take a look at this.

@charlierudolph
Copy link
Member

Oh very interesting. Appears this has to do with tags filtering out what pickles are actually run. Appears in fef94dd#diff-110f52e3c367c3dccfe5f61c927b3fead90dc3ae442cdfe2cf57703e158571eb we lost the idea about a pickle being accepted / rejected and thus the progress bar now doesn't have an accurate amount of total steps

@davidjgoss
Copy link
Contributor

@charlierudolph to fix this we could make the pickle filter available to the formatter.

Another option might be to base the count on testCases instead of pickles e.g:

if (doesHaveValue(envelope.testCase)) {
    this.numberOfSteps += envelope.testCase.testSteps.filter(testStep => doesHaveValue(testStep.pickleStepId)).length
}

That would yield the correct count (test steps that aren't from a hook), but it doesn't work at the moment because the timing is wrong - per #1408 testCase messages are emitted as we go along the test run, but the progress bar needs to have the count upfront before we start to run things. Could do that refactor after all to solve this?

@Tol1
Copy link

Tol1 commented May 7, 2021

This bugs me a lot on my custom formatter also. Any progress how to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants