2016-12-02 55 views
0

我剛剛創建了一個使用junit的平靜項目,運行良好,但生成的報告沒有格式。見下文。當我使用黃瓜創建一個寧靜項目時,報告按照預期格式化。是否有任何額外的步驟需要完成才能正確顯示報告。我所做的就是使用maven創建項目(mvn archetype:generate -Dfilter = serenity)。然後將其導入IntelliJ並運行它寧靜BDD與JUnit - 報告沒有格式化

report sample

我的POM文件是

http://maven.apache.org/xsd/maven-4.0.0.xsd「> 4.0.0

<groupId>serenityJUnit</groupId> 
<artifactId>serenityJUnitDemo</artifactId> 
<version>1.0-SNAPSHOT</version> 
<packaging>jar</packaging> 

<name>Serenity project with JUnit and WebDriver</name> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <serenity.version>1.1.38</serenity.version> 
    <webdriver.driver>firefox</webdriver.driver> 
</properties> 

<repositories> 
    <repository> 
    <snapshots> 
    <enabled>false</enabled> 
    </snapshots> 
    <id>central</id> 
    <name>bintray</name> 
    <url>http://jcenter.bintray.com</url> 
    </repository> 
</repositories> 
<pluginRepositories> 
    <pluginRepository> 
    <snapshots> 
    <enabled>false</enabled> 
    </snapshots> 
    <id>central</id> 
    <name>bintray-plugins</name> 
    <url>http://jcenter.bintray.com</url> 
    </pluginRepository> 
</pluginRepositories> 

<dependencies> 
    <dependency> 
     <groupId>net.serenity-bdd</groupId> 
     <artifactId>serenity-core</artifactId> 
     <version>${serenity.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-simple</artifactId> 
     <version>1.7.7</version> 
    </dependency> 
    <dependency> 
     <groupId>net.serenity-bdd</groupId> 
     <artifactId>serenity-junit</artifactId> 
     <version>${serenity.version}</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.12</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.assertj</groupId> 
     <artifactId>assertj-core</artifactId> 
     <version>1.7.0</version> 
    </dependency> 
</dependencies> 
<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.18.1</version> 
      <configuration> 
       <skip>true</skip> 
      </configuration> 
     </plugin> 
     <plugin> 
      <artifactId>maven-failsafe-plugin</artifactId> 
      <version>2.18.1</version> 
      <configuration> 
       <includes> 
        <include>**/*Test.java</include> 
        <include>**/Test*.java</include> 
        <include>**/When*.java</include> 
        <include>**/*Story.java</include> 
       </includes> 
       <argLine>-Xmx512m</argLine> 
       <systemPropertyVariables> 
        <webdriver.driver>${webdriver.driver}</webdriver.driver> 
       </systemPropertyVariables> 
      </configuration> 
      <executions> 
       <execution> 
        <goals> 
         <goal>integration-test</goal> 
         <goal>verify</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.2</version> 
      <configuration> 
       <source>1.7</source> 
       <target>1.7</target> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>net.serenity-bdd.maven.plugins</groupId> 
      <artifactId>serenity-maven-plugin</artifactId> 
      <version>${serenity.version}</version> 
      <executions> 
       <execution> 
        <id>serenity-reports</id> 
        <phase>post-integration-test</phase> 
        <goals> 
         <goal>aggregate</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

+0

現在全部排序。當我在serentity中評論以下行時,它起作用 – user3803807

+0

#自定義您的riequirements層次結構 #serenity.requirement.types = feature,story – user3803807

回答

0

工作當我註釋掉屬性文件中的以下行時

自定義您的riequirements層次結構

serenity.requirement.types =功能,故事