魅力报告-未生成Index.html

时间:2019-02-20 11:05:53

标签: selenium selenium-webdriver open-source reporting allure

当我们在Eclipse魅力报告(INDEX.HTML)中运行此代码时,不会仅在魅力报告文件夹中生成json文件。请帮助解决此问题。

->在目标中完成“干净的测试站点” [在Eclipse中运行配置]

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>example.property.manager</groupId>
      <artifactId>agents</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>

      <name>agents</name>
      <url>http://maven.apache.org</url>

      <properties>
         <aspectj.version>1.8.10</aspectj.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
       <dependencies>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.0</version>
            </dependency>
        <dependency>
       <groupId>io.github.bonigarcia</groupId>
       <artifactId>webdrivermanager</artifactId>
        <version>3.3.0</version>
    </dependency>
         <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.141.59</version>
        </dependency>
         <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>3.141.59</version>
        </dependency>  
        <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-chrome-driver</artifactId>
        <version>3.141.59</version>
    </dependency>
    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-testng</artifactId>
        <version>2.0-BETA19</version>
        <scope>test</scope>
    </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>1.3</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>1.7.21</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>
            <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-java-commons</artifactId>
            <version>2.6.0</version>
        </dependency>

        <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>3.0.0-M3</version>
      <type>maven-plugin</type>
    </dependency>
            </dependencies>
             <build>
            <plugins>
                <plugin>

                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M3</version>
                    <configuration>
                     <source>1.8</source>
                    <target>1.8</target>
                      <systemProperties>
                <property>
                  <name>allure-results</name>
                  <value>${allure.results.directory}</value>
                </property>
              </systemProperties>

                        <argLine>
                            -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                        </argLine>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjweaver</artifactId>
                            <version>${aspectj.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                  <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
              <version>3.8.0</version>
               <configuration>
                    <source>1.8</source>
                    <target>1.8</target>

            </configuration>
        </plugin>

            </plugins>
        </build>
        <reporting>
            <excludeDefaults>true</excludeDefaults>
            <plugins>
                <plugin>
                    <groupId>io.qameta.allure</groupId>
                    <artifactId>allure-maven</artifactId>
                    <version>2.9</version>
                     <configuration>
            <reportVersion>2.3.1</reportVersion>
        </configuration>
                                 </plugin>
            </plugins>
        </reporting>
    </project>

主班

  import java.io.IOException;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.testng.annotations.Test;
    import io.qameta.allure.Description;

    public class App 
    {
     @Test
    @Description("Rently Manager Portal")
        private static void Testcase1() {
            // TODO Auto-generated method stub
            FunctionalComponents page = new FunctionalComponents();
            page.launchapplication();
            page.authentication();
            page.closeAllDriver();
        }
    }

IDE -Eclipse 2018年12月 有谁遇到这类问题

0 个答案:

没有答案