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

Only scenarios should be considered as Tests (starting/ending cucumber and beforeFeature methods should not) #123

Open
AhmedDev98 opened this issue Jul 12, 2023 · 1 comment

Comments

@AhmedDev98
Copy link

Hello,
As a new user of this quarkus extension, I expected to see only my scenarios as tests launched, but it seems that cucumber specific actions (starting/ending cucumber, before/after methods) are shown as separate tests also.

After reading code in CucumberQuarkusTest, this behavior is due to creation of DynamicTests for start/end of cucumber, and beforeFeature) :

features.add(DynamicTest.dynamicTest("Start Cucumber", context::startTestRun));

tests.add(DynamicTest.dynamicTest("Start Feature", () -> context.beforeFeature(f)));

features.add(DynamicContainer.dynamicContainer(f.getName().orElse(f.getSource()), tests.stream()));

I may understand that's done in order to see each step separately, but this is causing the following issues when generating Junit surefire/failsafe reports:

  1. The number of tests shown is not correct
  2. Showing tests that are not really ones

In order to solve this issue, we my proceed as following:

  1. Create beforeAll and afterAll methods that will be responsible for starting/ending cucumber (in order to declare them as non static, we may need to add the following annotation: @TestInstance(TestInstance.Lifecycle.PER_CLASS)
  2. Include call to beforeFeature inside call of pickles (DynamicTests)

If you agree with this proposal, I can suggest a patch.

Thank you

@vsevel
Copy link

vsevel commented Aug 15, 2023

any news on this?
cc @stuartwdouglas @christophd @tisoft

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

No branches or pull requests

2 participants