2017-04-09 23 views
0

我試過命令mvn clean test site命令來生成誘惑報告。 xml file內部allure-results文件夾是用所有步驟正確創建的。 Howvever,index.html文件夾內site -> allure-maven-plugin文件夾爲空。 Overview中沒有顯示測試用例結果,或者在Allure報告中顯示任何其他部分。我使用Selenium WebDriverArquillianTestNG用步驟創建的傾城xml文件。 Index.html裏面的網站文件夾是空的 - 傾城Maven TestNG

請在下面找到我的POM文件:

<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>ABC</groupId> 
    <artifactId>XYZ</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <version.org.jboss.arquillian>1.1.12.Final</version.org.jboss.arquillian> 
     <version.org.jboss.arquillian.drone>2.1.0.Alpha1</version.org.jboss.arquillian.drone> 
     <version.org.jboss.arquillian.graphene>2.1.0.Final</version.org.jboss.arquillian.graphene> 
     <version.screenshooter>2.1.0.Final</version.screenshooter> 
     <version.javax.mail>1.5.6</version.javax.mail> 
     <jackson.version>2.7.0</jackson.version> 
     <aspectj.version>1.8.3</aspectj.version> 
     <allure.version>1.4.11</allure.version> 
     <version.maven.surefire>2.19.1</version.maven.surefire> 
    </properties> 
    <dependencies> 
    <dependency> 
     <groupId>org.testng</groupId> 
     <artifactId>testng</artifactId> 
     <version>6.11</version> 
    </dependency> 
     <dependency> 
     <groupId>ru.yandex.qatools.allure</groupId> 
     <artifactId>allure-testng-adaptor</artifactId> 
     <version>${allure.version}</version> 
     <exclusions> 
      <exclusion> 
       <groupId>junit</groupId> 
       <artifactId>junit</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>com.fasterxml.jackson.core</groupId> 
     <artifactId>jackson-databind</artifactId> 
     <version>${jackson.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.jboss.arquillian.testng</groupId> 
     <artifactId>arquillian-testng-standalone</artifactId> 
     <scope>test</scope> 
     </dependency> 
    <dependency> 
     <groupId>org.jboss.arquillian.graphene</groupId> 
     <artifactId>graphene-webdriver</artifactId> 
     <version>${version.org.jboss.arquillian.graphene}</version> 
     <type>pom</type> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.jboss.arquillian.graphene</groupId> 
     <artifactId>arquillian-browser-screenshooter</artifactId> 
     <version>${version.screenshooter}</version> 
    </dependency> 
    <dependency> 
     <groupId>com.google.code.gson</groupId> 
     <artifactId>gson</artifactId> 
     <version>2.8.0</version> 
    </dependency> 
    <dependency> 
     <groupId>com.github.jsurfer</groupId> 
     <artifactId>jsurfer-core</artifactId> 
     <version>1.2.8</version> 
    </dependency> 
    <dependency> 
     <groupId>com.sun.mail</groupId> 
     <artifactId>javax.mail</artifactId> 
     <version>${version.javax.mail}</version> 
     <scope>test</scope> 
    </dependency> 
    </dependencies> 
    <dependencyManagement> 
     <dependencies> 
     <!-- Arquillian Core dependencies --> 
     <dependency> 
      <groupId>org.jboss.arquillian</groupId> 
      <artifactId>arquillian-bom</artifactId> 
      <version>${version.org.jboss.arquillian}</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 
     <!-- Arquillian Drone dependencies and WebDriver/Selenium dependencies --> 
     <dependency> 
      <groupId>org.jboss.arquillian.extension</groupId> 
      <artifactId>arquillian-drone-bom</artifactId> 
      <version>${version.org.jboss.arquillian.drone}</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 
     </dependencies> 
    </dependencyManagement> 
    <build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>${version.maven.surefire}</version> 
      <configuration> 
       <testFailureIgnore>false</testFailureIgnore> 
       <argLine> 
        -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar 
       </argLine> 
       <suiteXmlFiles> 
        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile> 
        </suiteXmlFiles> 
        <properties> 
        <property> 
         <name>listener</name> 
         <value>ru.yandex.qatools.allure.testng.AllureTestListener</value> 
        </property> 
        </properties> 
      </configuration> 
      <dependencies> 
       <dependency> 
        <groupId>org.aspectj</groupId> 
        <artifactId>aspectjweaver</artifactId> 
        <version>${aspectj.version}</version> 
       </dependency> 
      </dependencies> 
      </plugin> 
      <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.6.1</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 
    </plugins> 
    </build> 
    <reporting> 
     <excludeDefaults>true</excludeDefaults> 
     <plugins> 
      <plugin> 
       <groupId>ru.yandex.qatools.allure</groupId> 
       <artifactId>allure-maven-plugin</artifactId> 
       <version>1.4.0</version> 
       <configuration> 
        <outputDirectory>${basedir}/target/allure-reports/</outputDirectory> 
        <allureResultsDirectory>${basedir}/target/allure-results</allureResultsDirectory> 
       </configuration> 
      </plugin> 
     </plugins> 
    </reporting> 
</project> 

請指引我。謝謝。

回答

0

上面的pom.xml工作正常。看起來像默認瀏覽器查看報告是Firefox。在IE和Chrome中打開時,index.html顯示爲空。結果顯示在Firefox瀏覽器中。需要找到改變這個默認配置的方法。