Перейти к содержимому

Фотография

junit reports

junit

  • Авторизуйтесь для ответа в теме
В этой теме нет ответов

#1 Serjant6993

Serjant6993

    Новый участник

  • Members
  • Pip
  • 15 сообщений

Отправлено 23 апреля 2020 - 05:54

Доброго времени суток. Для запуска своих тестов использую сборщик ant(1.9.8, Selenium 2.53.1, FF45, junit 4.12 и да можете закидывать камнями). Тесты запускаю suite'тами и в build.xml использую следующий junit task:

<target name="junit" depends="clean,compile">
        <mkdir dir="reports"/>
        <mkdir dir="reports/Screenchots/Errors"/>  
        <mkdir dir="reports/Screenchots/Failures"/>  
        <junit printsummary="yes" showoutput="yes" fork="yes" forkmode="once" outputtoformatters="yes">
            
            <classpath>
                <path refid="classpath"/>
                <pathelement location="classes"/>
            </classpath>
            
            <sysproperty key="log4j.configuration" value="file:log4j.properties"/>
            
            <formatter type="xml"/> 
            <formatter type="plain"/>
            
            <batchtest todir="reports"> 
                 
		<fileset dir="src"  includes="**/P1_LogicTests/P1_AllSuite/P1_SuiteTabInvoices.java"/> 
		<fileset dir="src"  includes="**/P1_LogicTests/P1_AllSuite/P1_SuiteTabComplaints.java"/>
		               
            </batchtest>
        </junit>
        <junitreport todir="reports">
            <fileset dir="reports">
                <include name="TEST-*.xml"/>
            </fileset>
            <report format="noframes" todir="reports/html"/>
        </junitreport>
    </target>

В тестах генерируются логи, которые привязаны к ConsoleAppender. Проблема в том, что в итоговых plain, Standard Output выводится только для первого suite. Сам suite class имеет следующий приблизительный вид:

@RunWith(Suite.class)
@Suite.SuiteClasses({ 
        P1_TestUpdateData.class,
        P1_TestAddFileAndChangeDescription.class,
        P1_TestSearchByNumber.class
})
public class P1_SuiteTabDelivery {
    
    public P1_SuiteTabDelivery() {
        super();
    }
    @BeforeClass
    public static void beforeClass() throws Exception {
    }
    
    @AfterClass
    public static void afterClass() throws Exception {
    }
}

  • 0



Темы с аналогичным тегами junit

Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных