1
我正在嘗試爲我們的集成測試設置allure2,但有些事情進展不順利。設置步驟和附件
TestNG監聽器工作正常,因爲魅力結果文件夾正在被填滿。像@Step和@Attachment這樣的註釋不起作用。
與來自https://github.com/allure-examples/allure-testng-example的示例相同的問題。 pom.xml中的
重要組成部分:
<dependencies> <dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>2.0-BETA14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.6</version>
</dependency>
<dependencies>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<argLine>
-
javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<groups>${groups}</groups>
<excludedGroups>${excludedGroups}</excludedGroups>
<properties>
<property>
<name>listener</name>
<value>
net.sprd.qa.webdriver.listener.ScreenshotListener,net.sprd.qa.common.listeners.TestPrinterListener,net.sprd.qa.cyo.listeners.Transformer,net.sprd.qa.common.listeners.JiraListener,net.sprd.qa.webdriver.listener.SlackListener,
</value>
</property>
<property>
<name>configfailurepolicy</name>
<value>continue</value>
</property>
<property>
<name>dataproviderthreadcount</name>
<value>${dataProviderthreadCount}</value>
</property>
</properties>
<systemPropertiesFile>
${propertiesFile}
</systemPropertiesFile>
<disableXmlReport>false</disableXmlReport>
<reportsDirectory>target/surefire-reports</reportsDirectory>
<parallel>methods</parallel>
<threadCount>${threadCount}</threadCount>
<forkCount>0</forkCount>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.8</version>
<configuration>
<resultsDirectory>../allure-results</resultsDirectory>
</configuration>
</plugin>
</plugins>
的JVM參數正確傳遞和路徑實際上是指向我aspectjweaver罐子。
問題:
- 我只看到在所有的示例中使用萬無一失插件。這可能是原因嗎?
- 我應該如何進一步調試?
- 我可以設置我的pom以防止出現此問題嗎?例如,以不同的方式加載aspectj依賴。