Всем привет!
Использую связку java(eclipse)+selenium+testng+maven.
Для красоты отчёта testng методы прямо в коде java называю русскими буквами:
@Test
public void Авторизация() throws InterruptedException {}
плюс вывожу информация, используя
Reporter.log("Привет");
- информация сохраняется в разделе отчёта “Reporter output”
В итоге в отчёте /target/surefire-reports/index.html получается неправильная кодировка. Screenshot by Lightshot
Логи, перед тестами:
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ag-web 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-clean-plugin:2.5:clean (default-clean) @ pro —
[INFO] Deleting /home/jaroslav/projects/PR/pro/target
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ pro —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ pro —
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 10 source files to /home/jaroslav/projects/PR/pro/target/classes
[INFO]
[INFO] — maven-resources-plugin:2.6:testResources (default-testResources) @ pro —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ pro —
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /home/jaroslav/projects/PR/pro/target/test-classes
[INFO]
[INFO] — maven-surefire-plugin:2.16:test (default-test) @ pro —
[INFO] Surefire report directory: /home/jaroslav/projects/PR/pro/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
pom.xml:
4.0.0
pr
pro
1.0-SNAPSHOT
jar
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>ru.stqa.selenium</groupId>
<artifactId>webdriver-factory</artifactId>
<version>1.1.46</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<argLine>-Dfile.encoding=UTF-8</argLine>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<!-- profiles -->
<profiles>
<profile>
<id>local</id>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<env>local</env>
<user.username></user.username>
<user.password></user.password>
<grid2.hub></grid2.hub>
<site.url>http://localhost/</site.url>
<browser.name>firefox</browser.name>
<browser.version></browser.version>
<browser.platform></browser.platform>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
</project>
п.с. У меня убунту 14.04
п.с.с. Или может быть как то по другому можно в этот отчёт добавить нормальные русские имена тестов, а не просто выводить названия методов?