黄瓜HTML报告带有时间戳的文件夹

问题描述 投票:0回答:1
       <plugin>
            <groupId>net.masterthought</groupId>
            <artifactId>maven-cucumber-reporting</artifactId>
            <version>${masterThougth.version}</version>
            <executions>
                <execution>
                    <id>execution</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <checkBuildResult>false</checkBuildResult>
                        <projectName>${project.artifactId}</projectName>
                        <buildNumber>${project.build}</buildNumber>
                        <parallelTesting>true</parallelTesting>
                        <outputDirectory>target/cucumber-report/</outputDirectory>
                        <cucumberOutput>target/cucumber-report/</cucumberOutput>
                    </configuration>
                </execution>
            </executions>
        </plugin>

我正在使用上面的maven cuc插件生成HTML测试报告。如何生成具有不同时间戳的黄瓜报告(文件夹)以用于不同的运行。

bdd cucumber-java
1个回答
2
投票

您可以尝试以下代码。

  <properties>
     <timestamp>${maven.build.timestamp}</timestamp>
     <maven.build.timestamp.format>yyyy_MM_dd_HH_mm</maven.build.timestamp.format>
  <properties>

    <plugin>
        <groupId>net.masterthought</groupId>
        <artifactId>maven-cucumber-reporting</artifactId>
        <version>${masterThougth.version}</version>
        <executions>
            <execution>
                <id>execution</id>
                <phase>verify</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
                <configuration>
                    <checkBuildResult>false</checkBuildResult>
                    <projectName>${project.artifactId}</projectName>
                    <buildNumber>${project.build}</buildNumber>
                    <parallelTesting>true</parallelTesting>
                    <outputDirectory>target/cucumber-report/${timestamp}</outputDirectory>
                    <cucumberOutput>target/cucumber-report/</cucumberOutput>
                </configuration>
            </execution>
        </executions>
    </plugin>
© www.soinside.com 2019 - 2024. All rights reserved.