2020년 1월 17일 금요일

TestNG의 ReportNG 설정법

pom.xml

<dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>${selenium.java.version}</version>
    </dependency>
    <dependency>
        <groupId>org.uncommons</groupId>
        <artifactId>reportng</artifactId>
        <version>${reportng.version}</version>
    </dependency>
    <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>${guice.version}</version>
    </dependency>
    ......
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.version}</version>
            <configuration>
                <encoding>UTF-8</encoding>
                <argLine>-Dfile.encoding=UTF-8</argLine>
                <properties>
                    <!-- Setting ReportNG listeners -->
                    <property>
                        <name>usedefaultlisteners</name>
                        <value>false</value>
                    </property>
                    <property>
                        <name>listener</name>
                        <value>org.uncommons.reportng.HTMLReporter,
                            org.uncommons.reportng.JUnitXMLReporter</value>
                    </property>
                </properties>
                <suiteXmlFiles>
                    <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </plugin>
        ......
    </plugins>
</build>


testng.xml(test-suite)

<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="TestNG Suite Name">
    <listeners>
        <listener class-name="org.uncommons.reportng.HTMLReporter" />
        <listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
    </listeners>
    <test name="tmon_monthly_maintenance">
        <classes>
            <class name="com.tmoncorp.test.maintenance.TmonHomeTest" />
            <class name="com.tmoncorp.test.maintenance.UserPageTest" />
            .....
        </classes>
    </test>
</suite>

댓글 없음:

댓글 쓰기