allure-java icon indicating copy to clipboard operation
allure-java copied to clipboard

Test body is missed in report if run test via "java org.testng.TestNG suite.xml"

Open shynkevichalex opened this issue 6 years ago • 30 comments

Pom.xml configured via documentation https://docs.qameta.io/allure/#_maven_3. When I run test via "mvn test" all works fine.

But I would build jar of test project then extract it on slaves and run tests via command "java org.testng.TestNG suite.xml"

Current result

Test report generates but test body is missed. image

Is there any solution to display test body when test run in this way?

shynkevichalex avatar Dec 04 '18 20:12 shynkevichalex

I have the same question,Have you found the solution?

LisaHoney avatar Jun 10 '19 04:06 LisaHoney

Currently I am facing the same issue. I have asked the same question on stack-overflow. https://stackoverflow.com/questions/57566093/allure-test-ng-report-testbody-is-missing @baev do you know any fix for this desperately looking for it. :-)

ucdevinda123 avatar Aug 20 '19 07:08 ucdevinda123

@LisaHoney @shynkevichalex did you find any solutions for this :-)

ucdevinda123 avatar Aug 20 '19 07:08 ucdevinda123

Guys, please update if any solution or workaround found

KroganUrdnot avatar Aug 26 '19 07:08 KroganUrdnot

@KroArtem Yeah same here desperately waiting for a workaround or solution.

ucdevinda123 avatar Aug 27 '19 02:08 ucdevinda123

@baev Any update on this issue?

ucdevinda123 avatar Sep 08 '19 01:09 ucdevinda123

@baev - Any update on this issue?

ss-04 avatar Sep 12 '19 23:09 ss-04

Observe same issue when in jest-allure. any fixes???

adamchenwei avatar Sep 16 '19 14:09 adamchenwei

@baev can you reply please?

ucdevinda123 avatar Sep 18 '19 16:09 ucdevinda123

You need to add AspectJWeaver javaagent to your command:

java -javaagent:aspectjweaver.jar -jar tests.jar org.testng.TestNG suite.xml

baev avatar Sep 18 '19 16:09 baev

AspectJWeaver agent is added as below

<argLine> javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar " </argLine>

Should we mention suite.xml as well?

Attaching pom.xml for reference Allure2POM.txt

Screen Shot 2019-09-18 at 10 53 12 AM

ss-04 avatar Sep 18 '19 17:09 ss-04

@baev - Any updates on the issue?

ss-04 avatar Oct 17 '19 05:10 ss-04

@baev - Any updates on the issue?

ss-04 avatar Oct 17 '19 05:10 ss-04

@baev I have almost the same issue and reported it here https://github.com/allure-framework/allure-java/issues/398 . Please help us fix this

pokeahontas avatar Oct 30 '19 11:10 pokeahontas

@baev Any update on this issue? Do we have any workaround?

gsai0205 avatar Mar 10 '20 21:03 gsai0205

@baev Any update on this issue? i have same problem

shalevoren avatar Apr 13 '20 08:04 shalevoren

any updates?

mohitrathi92 avatar Jul 05 '20 05:07 mohitrathi92

any updates?

biletsky avatar Dec 01 '20 13:12 biletsky

Was having the same issue, after hours and days of debugging found the solution that works for me.

Added aop.xml into resources/META-INF folder (if these is no such folder - create one)

The content of such xml should be:

<aspectj>
    <weaver> <!--<weaver options="-verbose -showWeaveInfo">-->
        <include within="io.qameta.allure..*"/>
        <include within="org.testng..*"/>
        <include within="com.changethispath.testautomation..*"/>
    </weaver>
</aspectj>

After that Test body with steps and screenshots are visible again.

anna-shchurok avatar Dec 17 '20 11:12 anna-shchurok

@galkina-anna <include within="com.changethispath.testautomation..*"/> Which path is it?

biletsky avatar Dec 18 '20 12:12 biletsky

@galkina-anna <include within="com.changethispath.testautomation..*"/> Which path is it?

path to tests package

anna-shchurok avatar Jan 18 '21 17:01 anna-shchurok

Try to use earlier version of aspectjweaver, e.g. 1.9.0

VladShapeshifter avatar Apr 23 '21 12:04 VladShapeshifter

@galkina-anna this aol.xml file should be added for test resources or for the main part of a project?

And a path for tests should be like src/test/resources/features?

Now I can't resolve this problem with your fix. Can you explain how do you solve this problem for your project? Thank you.

Allure Report

Sergiy1987 avatar May 19 '21 21:05 Sergiy1987

Could someone please given valid solution. I too facing this issue.

mohammedghouse36 avatar May 31 '21 12:05 mohammedghouse36

@Sergiy1987 sorry for slight delay in reply.

file should be added for test resources or for the main part of a project?

it should be in both places. Same file, same folder

And a path for tests should be like src/test/resources/features?

for me it was path to parent folder which contains page objects or test classes. As far as I understand just the path where allure need to search mentioning of itself

Can you explain how do you solve this problem for your project?

Basically the root cause of it this issue was third-party jar that also was using allure, so some collisions appeared. When I added those 2 files with direct mentioning where allure should search - it worked out for me.

anna-shchurok avatar Feb 04 '22 19:02 anna-shchurok

Is anybody have another workaround? I met the same issue.

jacksonwen001 avatar Feb 09 '22 05:02 jacksonwen001

It would be fine if you use the gradle to generate allure report.

jacksonwen001 avatar Feb 09 '22 07:02 jacksonwen001

Hi all, I'm using IntelliJ (TestNG + Maven). ### I found an easy solution for this issue: apparently running xml suites directly via the IntelliJ would not work fine, as described in this topic. My solution is:

  1. Download a compatible Maven version from [https://maven.apache.org/download.cgi]
  2. Extract the files (remember the path)
  3. Edit System Environment Variables: Add 2 System variables: 'M2_HOME' and 'MAVEN_HOME' - provide the relevant Maven installation library path - NOT including the bin file (e.g. C:\Automation\Maven\apache-maven-3.8.5-bin\apache-maven-3.8.5)
    Add 2 Paths: %M2_HOME%\bin and %MAVEN_HOME%\bin
  4. Restart windows
  5. Open cmd and verify the implementation by inserting 'mvn' and observing data (errors are fine at this moment, system should recognize the command 'mvn')
  6. Open IntelliJ's terminal and insert the next command: 'mvn test -Pweb' (P=profile - as configured in pom.xml, web=profile name - change it due to your configuration).
  7. After execution browse to allure report and observe results - Test body (and a screenshot, if implemented) should be appeared

Attached is an example for pom.xml profile: <profiles> <profile> <id>web</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> <configuration> <suiteXmlFiles> <suiteXmlFile>TestNGWeb.xml</suiteXmlFile> </suiteXmlFiles> <argLine> -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" </argLine> </configuration> </plugin> </plugins> </build> </profile> </profiles>

Tal-Raanan avatar Mar 16 '22 09:03 Tal-Raanan

I've been having this issue with allure-testng v.2.17.0 and TestNG v.7.5.0

The only thing that helped me was downgrading TestNG to 7.4.0 after which the test bodies started showing as they should.

So try playing around with allure-testng and testng versions to find the compatible combination

Fulcrum81 avatar Mar 24 '22 22:03 Fulcrum81

i solved this issue using code of this question

<reporting> <excludeDefaults>true</excludeDefaults> <plugins> <plugin> <groupId>io.qameta.allure</groupId> <artifactId>allure-maven</artifactId> <version>2.11.2</version> <configuration> <reportDirectory>${basedir}\target\allure-report</reportDirectory> </configuration> </plugin> </plugins> </reporting>

david-m-globant avatar Apr 07 '22 21:04 david-m-globant