Xceptance / neodymium-library

A test automation library based on common other best practice open source libraries. It adds missing functionalities but does not reinvent the wheel. Just glues stuff together nicely and adds some sprinkles.
MIT License
80 stars 11 forks source link

Fix displaying of ignore reasons for test methods in allure report #145

Closed oomelianchuk closed 4 years ago

oomelianchuk commented 4 years ago

There is an option to add a description toorg.junit.@Ignore to make Allure display a reason for test ignorance, like this: @Ignore("not implemented yet")/@Ignore("it's possible to add property with missing key")

so that allure report looks like this for the class: ignore_allure_class

and for the method: ignore_allure_test

Currently, this works only for class level and a test method annotated in the named above way will still be displayed as: ignore_allure_test_without_reason

This behavior can be caused by overriding the describeChild method of BlockJUnit4ClassRunner in the NeodymiumRunner. The method from Neodymium doesn't pass test method annotations to the description, which makes it impossible for allure to figure out the ignorance reason.

oomelianchuk commented 4 years ago

The issue can probably be fixed by editing the describeChild method to match the following code:

    @Override
    protected Description describeChild(FrameworkMethod method)
    {
        return childDescriptions.computeIfAbsent(method, (m) -> {
            return Description.createTestDescription(getTestClass().getJavaClass(), m.getName(), method.getAnnotations());
        });
    }
occupant23 commented 4 years ago

added the fix

occupant23 commented 4 years ago

@oomelianchuk and @h-arlt : Can be recheck.

h-arlt commented 4 years ago

Works as desired.