Привет! Пытаюсь по инструкции
http://wiki.qatools.ru/display/AL/Getting+Started
подключить к проекту Allure.
Есть несколько вопросов.
Мой pom-файл:
<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.epam</groupId>
<artifactId>underwriterTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aspectj.version>1.8.10</aspectj.version>
<allure.version>1.5.0</allure.version>
</properties>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<configuration>
<properties>
<allure.issues.tracker.pattern>http://example.com/%s</allure.issues.tracker.pattern>
</properties>
<resultsDirectory>allure-results</resultsDirectory>
<reportDirectory>allure-report</reportDirectory>
</configuration>
</plugin>
</plugins>
</reporting>
<dependencies>
<!-- https://mvnrepository.com/artifact/ru.yandex.qatools.allure/allure-testng-adaptor -->
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/ru.yandex.qatools.ashot/ashot -->
<dependency>
<groupId>ru.yandex.qatools.ashot</groupId>
<artifactId>ashot</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>
-javaagent:${settings.localRepository}\org\aspectj\aspectjweaver\${aspectj.version}\aspectjweaver-${aspectj.version}.jar
</argLine>
<skip>false</skip>
<suiteXmlFiles>
<suiteXmlFile>testng1.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
На сайте http://wiki.qatools.ru/display/AL/Allure+Maven+Plugin
описана настройка allure-maven-plugin.
Вопрос 1. Что означают строки:
<properties>
<allure.issues.tracker.pattern>http://example.com/%s</allure.issues.tracker.pattern>
</properties>
Что такое “http://example.com/%s” ?
Вопрос 2. При попытке скомпилировать тесты появляется ошибка
D:\Project\RGS-MNT\git rgs\ufo_qa\Kasko_Tests\underwriterTest>mvn test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building underwriterTest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.testng:testng:jar:5.14.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.testng:testng:jar:5.14.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.testng:testng:jar:5.14.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ underwriterTest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Project\RGS-MNT\git rgs\ufo_qa\Kasko_Tests\underwriterTest\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ underwriterTest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\Project\RGS-MNT\git rgs\ufo_qa\Kasko_Tests\underwriterTest\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[13,16] package baseTest does not exist
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[14,14] package driver does not exist
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[15,14] package driver does not exist
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[19,28] cannot find symbol
symbol: class BaseTest
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[20,17] cannot find symbol
symbol: class DriverEnum
location: class underwriterTest.scr.Test1
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[28,35] cannot find symbol
symbol: variable DriverEnum
location: class underwriterTest.scr.Test1
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[29,35] cannot find symbol
symbol: class Driver
location: class underwriterTest.scr.Test1
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[45,17] cannot find symbol
symbol: variable LOG
location: class underwriterTest.scr.Test1
[INFO] 8 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.563 s
[INFO] Finished at: 2017-01-10T10:34:50+03:00
[INFO] Final Memory: 21M/384M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project underwriterTest: Compilation failure: Compilation failure:
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[13,16] package baseTest does not exist
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[14,14] package driver does not exist
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[15,14] package driver does not exist
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[19,28] cannot find symbol
[ERROR] symbol: class BaseTest
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[20,17] cannot find symbol
[ERROR] symbol: class DriverEnum
[ERROR] location: class underwriterTest.scr.Test1
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[28,35] cannot find symbol
[ERROR] symbol: variable DriverEnum
[ERROR] location: class underwriterTest.scr.Test1
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[29,35] cannot find symbol
[ERROR] symbol: class Driver
[ERROR] location: class underwriterTest.scr.Test1
[ERROR] /D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java:[45,17] cannot find symbol
[ERROR] symbol: variable LOG
[ERROR] location: class underwriterTest.scr.Test1
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Т.е. он говорит, что класса нет по тому пути, где он его ищет. Его действительно там нет. Структура проекта такая:
В testng1.xml класс указан как
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="KaskoFailed">
<test verbose="2" name="Failed test">
<classes>
<class name="baseTest.Test1" />
</classes>
</test>
</suite>
Т.е. вопрос: откуда при запуске теста появился такой странный путь
D:/Project/RGS-MNT/git rgs/ufo_qa/Kasko_Tests/underwriterTest/src/main/java/underwriterTest/scr/Test1.java
?
Раньше (без allure в pom) классы запускались с тем же testng1.xml.