私はテストのためにspockフレームワークとgroovyを使用しています。また、私は魅力的なレポートを生成するために魅力的なスポーク1.0アダプターを使用しています。レポートは正常に見えますが、結果にステップが表示されません。 Groovyのすべてのメソッドには@Stepというアノテーションが付けられていますが、まだレポートには記録されていません。 これを修正するには?Allure @Stepアノテーションはgroovy/spockコードでは機能しません
0
A
答えて
0
pom.xmlにAspectJとallure-junit-adapterを追加して解決しました。 @Stepはspockテストで正しく処理されます。
のpom.xmlの例を参照してください:
<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>allure.spock.demo</groupId>
<artifactId>allure-spock</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<allure.version>1.4.23.HOTFIX1</allure.version>
<aspectj.version>1.8.9</aspectj.version>
<compiler.version>1.7</compiler.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<includes>
<include>**/*Spec.*</include>
</includes>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>1.1-groovy-2.4-rc-3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-junit-adaptor</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.6</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-spock-1.0-adaptor</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
</plugin>
</plugins>
</reporting>
0
チェックFAQ。私はあなたがjavaagentを追加する必要があると思います。 AspectJは、ステップ、添付ファイル、およびパラメータを処理するために使用されます。
+0
以前は、FAQにあるものを正確に行いましたが、pom.xmlにあるallure-junit-adapterの依存関係を小さな部分で追加しました!それがなければステップを記録しません。したがって、spock-adapterとallure-junit-adapterをインラインで追加し、AspectJに関連するすべてのものをpom.xmlに追加して、ステップを記録する必要があります。間接的な助けをありがとう) –
関連する問題
- 1. Spring @Transactionalは他のアノテーションでは機能しませんか?
- 2. @AutowiredアノテーションはSpringスタンドアロンアプリケーションでは機能しません
- 3. Hibernate @Columnアノテーションが機能しません
- 4. 私のコードは検索機能では機能しません
- 5. Springアノテーション@Autowiredを使用したコンストラクタインジェクションは機能しません
- 6. action = "somename"は<formで> Spring MVCアノテーションでは機能しません
- 7. 私の魅力レポートをカスタマイズするには@Stepと@AttachmentsはローカルワークスペースのTestNGでは機能しません
- 8. 年はJavaScriptコードでは機能しません
- 9. stricmpは私のコードでは機能しません
- 10. JMSSerializerおよびFOSRestBundle - アノテーションが機能しません。 「存在しません」
- 11. なぜコードはob_start()でしか機能しません。
- 12. Hibernate @生成されたアノテーションが機能しません
- 13. GWT AutoBean:アノテーション@PropertyNameがもう機能しません
- 14. Spring 3.2 Javaの純粋な設定の@valueアノテーションは機能しませんが、Environment.getPropertyが機能します
- 15. JSfiddleではコードは動作しますが、ローカルホストでは機能しません
- 16. コードはCodepenでは動作しますが、ブラウザでは機能しません。
- 17. nth-childコードが機能しません
- 18. Schaumのコードが機能しません!
- 19. エラーはありませんがjQueryコードは機能しません
- 20. カーソル座標コードは他のjavascriptコードでは機能しません
- 21. Forループはカスタム機能では機能しません
- 22. 戻り値falseはJavaScript機能では機能しません
- 23. JS機能はイオンアプリでは機能しません
- 24. $ routeParamsは解決機能では機能しません
- 25. Wordpressの機能はカスタムテーマでは機能しません
- 26. 新しい機能はChromeの機能では機能しません
- 27. document.getElementByIdは機能しますが、document.getElementsByTagNameは機能しません
- 28. JQuery Ajax - コードは今では機能しませんでしたか?
- 29. eventListenerを使用したJavascriptコードでは、ビデオボタンコントロールシステムでは機能しません
- 30. ブートストラップモーダルでは機能しません
は、スタックオーバーフローへようこそ!良い質問をするのを助けるために私たちの[SO Question Checklist](http://meta.stackoverflow.com/questions/260648/stack-overflow-question-checklist)をよく読んで、良い答えを得てください。 –