Всем привет! Проблема заключается в том, что у меня генерируется пустой Allure отчет для тестов Rest Assured.
Последовательность действий следующая:
- Я запускаю тесты:
mvn test -Dtest=${MyClass}
- Генерирую отчет командой
mvn allure:report
- Запускаю jetty сервер
mvn jetty:run
Но в качестве результата я вижу пустой отчет, он больше похож на шаблон отчета. Вероятно причина кроется в конфигурации pom.xml, возможно не хватает зависимостей или наоборот присутствуют конфликты.
мой pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.testtask</groupId>
<artifactId>com.testtask</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version>
<maven.surefire.plugin.version>3.0.0-M3</maven.surefire.plugin.version>
<aspectj.version>1.9.3.RC1</aspectj.version>
<jetty.maven.plugin.version>9.3.9.v20160517</jetty.maven.plugin.version>
<allure.maven.version>2.10.0</allure.maven.version>
<rest.assured.version>3.3.0</rest.assured.version>
<allure.rest.assured.version>2.10.0</allure.rest.assured.version>
<allure.testng.version>2.10.0</allure.testng.version>
<junit.version>4.12</junit.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!--Running tests-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<!--Server to view the report-->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.maven.plugin.version}</version>
<configuration>
<webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>
<stopKey>stop</stopKey>
<stopPort>1234</stopPort>
</configuration>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>${allure.maven.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<!--Rest Assured section-->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>${rest.assured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-path</artifactId>
<version>${rest.assured.version}</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>xml-path</artifactId>
<version>${rest.assured.version}</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-schema-validator</artifactId>
<version>${rest.assured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-rest-assured</artifactId> <!--generates attachment for allure-->
<version>${allure.rest.assured.version}</version>
</dependency>
<!--Allure TestNG Dependency-->
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>${allure.testng.version}</version>
</dependency>
<!-- Java 6 = JAX-B Version 2.0 -->
<!-- Java 7 = JAX-B Version 2.2.3 -->
<!-- Java 8 = JAX-B Version 2.2.8 -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
запуск команды mvn allure:report
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.testtask:com.testtask >----------------------
[INFO] Building com.testtask 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- allure-maven:2.10.0:report (default-cli) @ com.testtask ---
[INFO] Allure installation directory C:\PRJ\X\PetAPI/.allure
[INFO] Try to finding out allure 2.8.1
[INFO] Generate Allure report (report) with version 2.8.1
[INFO] Generate Allure report to C:\PRJ\X\PetAPI\target\site/allure-maven-plugin
[INFO] Found results directory C:\PRJ\X\PetAPI\target\allure-results
[INFO] Can't find information about categories.
[INFO] Generate report to C:\PRJ\X\PetAPI\target\site\allure-maven-plugin
Report successfully generated to C:\PRJ\X\PetAPI\target\site\allure-maven-plugin
[INFO] Report generated successfully.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.433 s
[INFO] Finished at: 2019-03-17T02:49:13+04:00
[INFO] ------------------------------------------------------------------------
запуск команды mvn jetty:run
INFO] Configuring Jetty for project: com.testtask
[INFO] Webapp source directory = C:\PRJ\X\PetAPI\target\site\allure-maven-plugin
[INFO] Reload Mechanic: automatic
[INFO] Classes = C:\PRJ\X\PetAPI\target\classes
[INFO] Logging initialized @7653ms
[INFO] Context path = /
[INFO] Tmp directory = C:\PRJ\X\PetAPI\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = null
[INFO] Webapp directory = C:\PRJ\X\PetAPI\target\site\allure-maven-plugin
[INFO] jetty-9.3.9.v20160517
[INFO] Started o.e.j.m.p.JettyWebAppContext@5c77ba8f{/,file:///C:/PRJ/X/PetAPI/target/site/allure-maven-plugin/,AVAILABLE}{file:///C:/PRJ/X/PetAPI/target/site/allure-maven-plugin/}
[INFO] Started ServerConnector@2aaf152b{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO] Started @12600ms
[INFO] Started Jetty Server
Помогите пожалуйста разобраться с проблемой