allure-java
allure-java copied to clipboard
Disable StepAspects possible?
How can I disable io.qameta.allure.aspects.StepAspects? I would like to replace it with my own implementation because I want to abbreviate too large parameter values automatically.
you can create a custom annotation instead of default one, or you can try to exclude io.qameta.allure.aspects
package from weaving (by using aop.xml)
I figured it out:
<aspectj>
<!-- <weaver options="-warn:none -Xlint:ignore"/>-->
<weaver options="-verbose"/>
<aspects>
<aspect name="com.foobar.CustomStepsAspects"/>
<exclude within="io.qameta.allure.aspects.StepsAspects"/>
</aspects>
</aspectj>
But I have a problem with the JUnit test. Only the first test passes, the other tests fail because of:
AllureLifecycle - Could not start step: no test case running
The aspect and the test classes are exact copies in my project. If I do not activate my copy of the aspect and do not exclude the original aspect then my copy of the test runs.
It is because I have also a custom aspect implementation for AllureAssertJ in the same Gradle subproject called "common". I do not want to put each aspect into a separate subproject. Is it possible to have these two aspects in the same Gradle subproject and that their tests do not interfere with each other?
I don't know, but in the end it did not work to make these tests running, I spent hours with finding the reason.
I think I will try to create an aspect for the toString() methods instead of these parameter object types which can be too long, in order to abbreviate them so that they are also abbreviated in the Allure report.
However I still believe it would make sense to have the option to limit the maximum string length of these parameter values for the Allure report. These values can be very long with big JSON requests and responses, and if there are many tests, it could blow up the Allure report.