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

Serenity reports shows 0 steps but test passed if junit.Assume is used in before method #1562

Closed
BushnevYuri opened this issue Feb 7, 2019 · 7 comments

Comments

@BushnevYuri
Copy link

BushnevYuri commented Feb 7, 2019

Hello guys,

We will be very glad if you can help with a fix or point out the place where it can be fixed.
We want to ignore some tests based on some conditions via before method. If you use "junit.Assume" which doesn't match condition then the test is marked as ignored in JUnit as expected (standard usage of this method). This is quite common way of ignoring tests in JUnit and it works perfect in case you use just JUnit itself. But serenity report shows this test as passed anyway having 0 steps inside.

How we ignore:
@Before public void beforeMethod() { org.junit.Assume.assumeTrue(someCondition()); }

Serenity report:
screenshot 2019-02-07 at 12 04 52

@wakaleo
Copy link
Member

wakaleo commented Feb 7, 2019

This would be in the JUnitRunner class in serenity-junit, which I don't think would know what to do with an Assume failure, so it must just ignore it but not trigger the correct outcome in the StepEventBus. Please feel free to take a look.

@BushnevYuri
Copy link
Author

@wakaleo Thanks. Unfortunately, couldn't find easy tweak. Will try to back to it later.

@adeellis
Copy link

adeellis commented Feb 8, 2021

Additional info which may help:
I have 0 steps showing on my report but all tests have passed which seems like similar behaviour to the original post.
I am running a project with JUnit tests only (no cucumber tests, no cucumber dependencies in the pom).
If I use serenity versions 2.1.6, 2.2.0, 2.2.2, 2.2.5 the steps show correctly on the report when I drill into them.
The steps disappear in version 2.2.12 and later versions.
If I run the same project with a later version of serenity e.g. 2.2.12 (with no changes made to my project) the steps show as 0 in the report. The tests still all are running successfully as I can see them in the console and on the report home page.

I have also noticed that the results.csv download icon has also 'disappeared' from the serenity report home page when this issue manifests itself. But I can see the results.csv is present in the correct serenity folder.

https://github.com/serenity-bdd/serenity-core/#what-is-the-latest-stable-version-i-should-use

@anshulchhajed
Copy link

anshulchhajed commented May 3, 2021

@wakaleo
I am using Spring in my Serenity-Cucumber framework.
Can we replace @steps with @Autowired annotation?

@wakaleo
Copy link
Member

wakaleo commented May 3, 2021

No

@wakaleo wakaleo closed this as completed Feb 12, 2022
@sandy340
Copy link

any suggestion for above problem as i have tried all versions as mentioned above but still step showing 0
image

@wakaleo
Copy link
Member

wakaleo commented Aug 15, 2022

any suggestion for above problem as i have tried all versions as mentioned above but still step showing

You are commenting on a closed issue relating to an old version of Serenity - you might need to provide some more details about the problem you are having.

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

No branches or pull requests

5 participants