Selenide + TestNG + Maven + Allure.
Запускаю тесты через консоль коммандой mvn clean test site jetty:run
Отчет успешно формируется, но не отображаются Steps в тест кейсе. При этом отображение параметров в тесте @Parameter работает. Помогите пожалуйста разобраться в причине.
Пример использования:
@Step
public void step(){
// some actions
}
@Test
public void test(){
// some test actions
step();
// some another actions
}
POM:
<?xml version="1.0" encoding="UTF-8"?>
<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>com.*****</groupId>
<artifactId>tests</artifactId>
<version>1.0-**********</version>
<properties>
<aspectj.version>1.7.4</aspectj.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-report-data</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-aspects</artifactId>
<version>1.5.0.RC2</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>LATEST</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/ru.yandex.qatools.allure/allure-bundle -->
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-bundle</artifactId>
<version>1.5.0.RC2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<forkCount>0</forkCount>
<suiteXmlFiles>
<suiteXmlFile>${basedir}/src/test/resources/tests.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
<name>listener</name>
<value>ru.yandex.qatools.allure.testng.AllureTestListener</value>
</property>
</properties>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.10.v20150310</version>
<configuration>
<webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>
<stopKey>stop</stopKey>
<stopPort>1234</stopPort>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<excludeDefaults>true</excludeDefaults>
<outputDirectory>${project.build.directory}/site</outputDirectory>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>LATEST</version>
<configuration>
<resultsPattern>${project.build.directory}/allure-results</resultsPattern>
<resultsDirectory>allure-results</resultsDirectory>
<properties>
<allure.issues.tracker.pattern>https://issues.corp.twilio.com/browse/%s</allure.issues.tracker.pattern>
</properties>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
Denis_Klopushko:
@Step
а текст там внутри есть? Пример:
@Step("Some text")
public void step(){
// some actions
}
Да, текст передаю. Вообще пробовал 2 варианта и с текстом и без него, результат тот же.
ArtOfLife
(Sergey Korol)
19.Декабрь.2016 19:56:24
#4
Для начала, приведите в порядок pom.xml
. Там много всего намешано, не говоря уже о неактуальных версиях.
Тогда попробуйте с версией такой:
<allure.version>1.5.0</allure.version>
Версии с которыми все работает:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<!--<parent>-->
<!--<groupId>org.sonatype.oss</groupId>-->
<!--<artifactId>oss-parent</artifactId>-->
<!--<version>7</version>-->
<!--</parent>-->
<groupId>.......</groupId>
<artifactId>.........</artifactId>
<version>v1.0</version>
<name>.......</name>
<description>....</description>
<developers>
<developer>
<id>evgmoskalenko</id>
<name></name>
<email></email>
<organization></organization>
<organizationUrl></organizationUrl>
<roles>
<role></role>
</roles>
</developer>
</developers>
<properties>
<!-- Default browser-->
<browser>chrome</browser>
<!--<browser>phantomjs</browser>-->
<!-- Configuration -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<suiteFile>${project.basedir}/suite.xml</suiteFile>
<!-- Dependencies Versions -->
<compiler.version>1.8</compiler.version>
<testng.version>6.9.4</testng.version>
<allure.version>1.5.0</allure.version>
<!--<allure.version>1.5.0-RC1</allure.version>-->
<htmlelements.java.version>1.14</htmlelements.java.version>
<selenide.version>4.1</selenide.version>
<aspectj.version>1.8.9</aspectj.version>
<video-recorder-testng.version>LATEST</video-recorder-testng.version>
<rendersnake.version>1.9.0</rendersnake.version>
<commons-collections.version>3.2.2</commons-collections.version>
<!--Plugin Versions-->
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19</maven-surefire-plugin.version>
<allure-maven-plugin.version>2.2</allure-maven-plugin.version>
<versions-maven-plugin.version>2.2</versions-maven-plugin.version>
<logging.log4j>2.2</logging.log4j>
<slf4j-simple>1.7.19</slf4j-simple>
<yaml.config.version>1.17</yaml.config.version>
<!-- Directory Properties -->
<resource-test.directory>${project.basedir}/src/test/resources</resource-test.directory>
<allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
<allure.report.directory>${project.build.directory}/site/allure-report</allure.report.directory>
<!-- Management System Properties -->
</properties>
<dependencies>
<!-- Selenide-->
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>${selenide.version}</version>
</dependency>
<!-- TestNG -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<!--<scope>compile</scope>-->
<!--<scope>test</scope>-->
</dependency>
<!-- Allure -->
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.htmlelements</groupId>
<artifactId>htmlelements-java</artifactId>
<version>${htmlelements.java.version}</version>
</dependency>
<!-- VideoRecorder-->
<dependency>
<groupId>com.automation-remarks</groupId>
<artifactId>video-recorder-testng</artifactId>
<version>${video-recorder-testng.version}</version>
</dependency>
<dependency>
<groupId>org.rendersnake</groupId>
<artifactId>rendersnake</artifactId>
<version>${rendersnake.version}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons-collections.version}</version>
</dependency>
<!-- logger -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${logging.log4j}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${logging.log4j}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-simple}</version>
</dependency>
<!-- YAML-->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${yaml.config.version}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.name}-${project.version}</finalName>
<resources>
<resource>
<directory>${resource-test.directory}</directory>
<filtering>true</filtering>
</resource>
</resources>
<!--<defaultGoal>dependency:copy-dependencies</defaultGoal>-->
<plugins>
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-archetype-plugin</artifactId>-->
<!--<version>${maven-archetype-plugin.version}</version>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${compiler.version}</source>
<target>${compiler.version}</target>
</configuration>
</plugin>
<!-- Allure -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<parallel>methods</parallel>
<threadCount>5</threadCount>
<testFailureIgnore>true</testFailureIgnore>
<detail>true</detail>
<forkCount>1C</forkCount>
<reuseForks>true</reuseForks>
<systemPropertyVariables>
<browser>${browser}</browser>
</systemPropertyVariables>
<argLine>
-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
<!-- -DBUILD_URL=${BUILD_URL}-->
</argLine>
<suiteXmlFiles>
<suiteXmlFile>${suiteFile}</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<!--<plugin>-->
<!--<groupId>org.mortbay.jetty</groupId>-->
<!--<artifactId>jetty-maven-plugin</artifactId>-->
<!--<configuration>-->
<!--<webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>-->
<!--</configuration>-->
<!--</plugin>-->
</plugins>
</build>
<!-- Allure Reporting -->
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>${allure-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<reportSets>
<reportSet>
<reports>
<report>dependency-updates-report</report>
<report>plugin-updates-report</report>
<report>property-updates-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
<outputDirectory>${basedir}/target/site</outputDirectory>
</reporting>
</project>
Eugene, спасибо. Использовал Ваш pom и все заработало.
Очень благодарен.
не за что, скорее всего дело было в версии <allure.version>1.5.0</allure.version>
, поэксперементируйте
мой pom.xml пока еще не идеален
Менял версию на указанную в своем старом, помогло не на 100%.
Отображались только STARTED и FINISHED. Остальные шаги не отображались по прежнему.
Поэкперементировал с версиями, не помогло.
Сработало только когда полностью заменил =)
Яссненько Ну вам там некоторые депенденси, могут не понадобиться, если что, вот это можете убирать:
<!-- VideoRecorder-->
<dependency>
<groupId>com.automation-remarks</groupId>
<artifactId>video-recorder-testng</artifactId>
<version>${video-recorder-testng.version}</version>
</dependency>
<dependency>
<groupId>org.rendersnake</groupId>
<artifactId>rendersnake</artifactId>
<version>${rendersnake.version}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons-collections.version}</version>
</dependency>
<!-- YAML-->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${yaml.config.version}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.1</version>
<scope>test</scope>
</dependency>
Да, спасибо. Я понял, что они не надо.
Доброго дня!
Люди добрые )) я учусь на автоматизатора в команде с 8-ми человек. Перечитал все темы с аннотацией @Step , но так и не разобрался, почему не отображаються в Allure. Также проблема с линками @TestCaseId (добавляется путь к отчету + айдишка). @Features , @Stories , @Severity , @Description работают и отображаются в отчете. Помка общая, бросали все все кому что не лень. Понимаю, что в этом ковырятся не охота, но если вдруг у кого появиться желание поволонтерствовать, я, от лица всей нашей дримтим))), буду очень благодарен)))))
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
<groupId>com.company</groupId>
<artifactId>demo</artifactId>
<version>1.0</version>
<properties>
<!-- - - - - - Encoding - - - - - -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.resources.plugin.version>2.7</maven.resources.plugin.version>
<!-- - - - - - Java - - - - - -->
<jdk.source.version>1.8</jdk.source.version>
<jdk.compiler.version>1.8</jdk.compiler.version>
<jdk.source.ci.version>1.7</jdk.source.ci.version>
<jdk.compiler.ci.version>1.7</jdk.compiler.ci.version>
<maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
<!-- - - - - - DB - - - - - -->
<net.sourceforge.jtds.version>1.3.1</net.sourceforge.jtds.version>
<mysql.connector.version>5.1.37</mysql.connector.version>
<postgresql.connector.version>9.4-1200-jdbc41</postgresql.connector.version>
<!-- - - - - - Test - - - - - -->
<org.testng.version>6.8</org.testng.version>
<testng.reports.directory>./target/surefire-reports/test-output</testng.reports.directory>
<maven.surefire.plugin.version>2.19.1</maven.surefire.plugin.version>
<allure-maven-plugin.version>2.5</allure-maven-plugin.version>
<org.seleniumhq.version>3.0.1</org.seleniumhq.version>
<versions-maven-plugin.version>2.2</versions-maven-plugin.version>
<!-- - - - - - Logging - - - - - -->
<org.slf4j.version>1.7.13</org.slf4j.version>
<logging.log4j>2.2</logging.log4j>
<slf4j-simple>1.7.19</slf4j-simple>
<yaml.config.version>1.17</yaml.config.version>
<!-- - - - - - Utils - - - - - -->
<org.apache.poi.version>3.13</org.apache.poi.version>
<xerces.xercesImpl.version>2.11.0</xerces.xercesImpl.version>
<allure.version>1.5.0</allure.version>
<aspectj.version>1.8.5</aspectj.version>
<xmlrun>testngOMS.xml</xmlrun>
</properties>
<dependencies>
<!-- - - - RegEx - - - -->
<dependency>
<groupId>regexp</groupId>
<artifactId>regexp</artifactId>
<version>1.3</version>
</dependency>
<!-- - - - Assert helper - - - -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<!-- - - - DBConnect - - - -->
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>${net.sourceforge.jtds.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<!-- YAML -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${yaml.config.version}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.1</version>
<scope>test</scope>
</dependency>
<!-- - - - - - Tests - - - - - -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${org.testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${org.seleniumhq.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
<!-- - - - Read from Excel formats, etc. - - - -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>${jdk.source.version}</source>
<target>${jdk.compiler.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<argLine>-Xms256m -Xmx512m</argLine>
<skipTests>false</skipTests>
<systemPropertyVariables>
<surefire.reports.directory>
${testng.reports.directory}
</surefire.reports.directory>
</systemPropertyVariables>
<suiteXmlFiles>
<file>${xmlrun}</file>
</suiteXmlFiles>
<reportsDirectory>${testng.reports.directory}</reportsDirectory>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>${allure-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<reportSets>
<reportSet>
<reports>
<report>dependency-updates-report</report>
<report>plugin-updates-report</report>
<report>property-updates-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
<outputDirectory>${basedir}/target/site</outputDirectory>
</reporting>