0

ここで指定されている ReportNG のシステム サポート プロパティを使用したいのですが、testng.xml ファイルを使用してテストを実行しません。テストは、maven コマンド ラインで TestNG グループを指定することによって実行されます。pom.xml ファイルで ReportNG システム プロパティを次のように指定しました。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <executions>
        <execution>
            <id>default-test</id>
            <goals>
                <goal>test</goal>
            </goals>
            <configuration>
                <argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine>
                <properties>
                    <property>
                        <name>usedefaultlisteners</name>
                        <value>false</value>
                    </property>
                    <property>
                        <name>listener</name>
                        <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
                    </property>
                </properties>
                <systemProperties>
                    <systemProperty>
                        <name>org.uncommons.reportng.frames</name>
                        <value>false</value>
                    </systemProperty>
                    <systemProperty>
                        <name>org.uncommons.reportng.title</name>
                        <value>OBS Test Report</value>
                    </systemProperty>
                </systemProperties>
                <systemPropertyVariables>
                    <target.host>${target_host}</target.host>
                    <target.port>22</target.port>
                </systemPropertyVariables>
            </configuration>
        </execution>
    </executions>
</plugin>

ただし、プロパティorg.uncommons.reportng.framesorg.uncommons.reportng.titleは、生成されたレポート レポートには影響しません。これらのプロパティはどこで指定する必要がありますか?

4

1 に答える 1

1

次のようにpom.xmlを使用して解決策を見つけました-

 <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine>
                                <properties>
                                    <property>
                                        <name>listener</name>
                                        <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
                                    </property>
                                </properties>
                                <systemPropertyVariables>
                                    <org.uncommons.reportng.title>OBS Test Suite</org.uncommons.reportng.title>
                                    <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
                                </systemPropertyVariables>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
于 2016-08-18T15:09:47.417 に答える