2016-07-15 3 views
0

Gebは、テストケースを実行中に、設定されたレポートディレクトリのスクリーンショットを.pngファイルおよびDOM要素をHTMLファイルとして受け取ります。Geb:テスト失敗のためのレポートファイルの作成

私は失敗の結果を提出しなければならないので、私は、以下のファイルのようにテストの失敗の詳細を記述することも必要があります。

title == "SomeTitleHere" 
|  | 
|  false 
SomeAnotherTitleHere 

がどのように私はこれを達成することができますか何それを行うための最善の方法は何ですか?

答えて

0

最後に、テストの失敗の詳細をHTML形式で記述すると良い解決策が見つかりました。 Eclipse [Mars]でMavenプロジェクトとしてプロジェクトを作成したので、pom.xmlに次の依存関係を追加すると、ビルドディレクトリに.htmlレポートファイルが作成されます。

<dependency> 
    <groupId>com.athaydes</groupId> 
    <artifactId>spock-reports</artifactId> 
    <version>1.2.12</version> 
    <scope>test</scope> 
    <!-- this avoids affecting your version of Groovy/Spock --> 
    <exclusions> 
    <exclusion> 
     <groupId>*</groupId> 
     <artifactId>*</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 

<!-- // if you don't already have slf4j-api and an implementation of it in the  classpath, add this! --> 
<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-api</artifactId> 
    <version>1.7.13</version> 
    <scope>test</scope> 
</dependency> 
<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-simple</artifactId> 
    <version>1.7.13</version> 
    <scope>test</scope> 
</dependency> 
関連する問題