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

Feature: Support Cucumber usage reporter #113

Open
adamwood-novafori opened this issue Mar 19, 2024 · 5 comments
Open

Feature: Support Cucumber usage reporter #113

adamwood-novafori opened this issue Mar 19, 2024 · 5 comments
Labels
enhancement New feature or request reporter

Comments

@adamwood-novafori
Copy link

The problem
I find it hard to find out if I have any unused steps

A solution
When running bddgen export it would be nice to see a count next to the step name to locate any unused ones

@adamwood-novafori adamwood-novafori added the enhancement New feature or request label Mar 19, 2024
@Zialus
Copy link

Zialus commented Mar 19, 2024

This is available as the usage reporter plugin of cucumber.js. Unfortunately it doesn't seems to be supported yet on playwright-bdd, even after the recent addition of cucumber reports.

@vitalets vitalets changed the title Feature: Listing step along with number of usages Feature: Support Cucumber usage reporter Mar 20, 2024
@vitalets
Copy link
Owner

vitalets commented Mar 20, 2024

Good point, we should definitely support Cucumber usage reporter. The reason why it is not implemented yet - it relies on step definitions. To have them in Playwright reporter output, playwright-bdd should re-read step definition files once again in the reporter process or pass them as a metadata.

Another option as a lightweight solution - enhance bddgen export command to output unused steps, e.g. bddgen export --unused-steps. The output will not contain duration of each step, but the command will run very fast, because it does not actually run tests.

@adamwood-novafori
Copy link
Author

Maybe lightweight solution first and support usage reporter further down the line?

@vitalets
Copy link
Owner

Partially related to #53

@vitalets
Copy link
Owner

vitalets commented Apr 6, 2024

Flag --unused-steps released in v6.1.0. Now you can run:

npx bddgen export --unused-steps

Output:

Using config: playwright.config.ts
List of unused steps (1):
* Then I see in title {string}

Currently unused steps are displayed without file location, will add it in the next release.

Keep this issue open for Cucumber usage reporter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reporter
Projects
None yet
Development

No branches or pull requests

3 participants