提交 88b1357b authored 作者: mry's avatar mry

fix(报告显示中文):报告显示中文信息

上级 b93592b7
......@@ -23,6 +23,11 @@
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
......@@ -103,6 +108,15 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
......
......@@ -10,6 +10,7 @@ import org.springframework.stereotype.Component;
import org.testng.Assert;
import org.testng.Reporter;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.io.File;
......@@ -74,7 +75,6 @@ public class ConferenceActive {
//修改test会议室
private void updateErrorMeetTest() {
meetManager();
WebElement tbody = webDriver.findElement(By.xpath("/html/body/div/div/div[2]/div[2]/div/div/div[2]/div[1]/div[3]/table/tbody"));
List<WebElement> rows = tbody.findElements(By.className("el-table__row"));
for (WebElement row : rows) {
......@@ -96,9 +96,10 @@ public class ConferenceActive {
//todo 这个系统暂时没有登录的功能
}
@BeforeMethod
//进入页面,并且到达会议室库管理页面
public void meetManager() {
webDriver.get("http://123.60.53.83");
webDriver.get("http://123.60.53.83/");
webDriver.manage().window().maximize();
webDriver.findElement(By.xpath("/html/body/div/div/div[1]/div[2]/div[2]/span")).click();
webDriver.findElement(By.xpath("/html/body/div/div/div[2]/div[1]/div/ul/li/div/span")).click();
......@@ -109,7 +110,6 @@ public class ConferenceActive {
public void resetTest() {
try {
String test;
meetManager();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input")).click();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input")).clear();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input")).sendKeys("100");
......@@ -128,7 +128,6 @@ public class ConferenceActive {
@Test(description = "查询人数,输入负号")
public void findUnNumber() {
try {
meetManager();
//容纳人数查询
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input")).click();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input")).clear();
......@@ -153,7 +152,6 @@ public class ConferenceActive {
public void findMeetName() {
try {
String test;
meetManager();
//会议室名称查询
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input")).click();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input")).clear();
......@@ -181,7 +179,6 @@ public class ConferenceActive {
public void findNumberMeet() {
try {
String test;
meetManager();
//容纳人数查询
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input")).click();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[2]/div/div/div/input")).clear();
......@@ -197,7 +194,6 @@ public class ConferenceActive {
@Test(description = "按照会议室规模查询")
public void findScaleMeet() {
try {
meetManager();
WebElement find = webDriver.findElement(By.xpath("/html/body/div/div/div[2]/div[2]/div/div/div[1]/form/div/div[4]/button[1]/span"));
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[3]/div/div/div/div/input")).click();
webDriver.findElement(By.xpath("/html/body/div[2]/div[1]/div[1]/ul/li[1]/span")).click();
......@@ -221,7 +217,6 @@ public class ConferenceActive {
public void findMeet() {
try {
String test;
meetManager();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input")).click();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input")).clear();
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/form/div/div[1]/div/div/div/input")).sendKeys("G");
......@@ -254,7 +249,6 @@ public class ConferenceActive {
@Test(description = "会议室新增测试")
public void insertMeet() {
try {
meetManager();
//点击新增
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/button/span")).click();
popUp("test", "test1", "100");
......@@ -275,7 +269,6 @@ public class ConferenceActive {
@Test(description = "新增null会议")
public void insertNullMeetFail() {
try {
meetManager();
//点击新增
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/button/span")).click();
//点击保存
......@@ -301,7 +294,6 @@ public class ConferenceActive {
@Test(description = "新增错误会议室")
public void insertErrorMeet() {
try {
meetManager();
//点击新增
webDriver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div[2]/div/div/div[1]/button/span")).click();
popUp("test", "test1", "-qwe123");
......@@ -358,7 +350,6 @@ public class ConferenceActive {
@Test(description = "会议室删除测试")
public void deleteMeet() {
try {
meetManager();
WebElement tbody = webDriver.findElement(By.xpath("/html/body/div/div/div[2]/div[2]/div/div/div[2]/div[1]/div[3]/table/tbody"));
List<WebElement> rows = tbody.findElements(By.className("el-table__row"));
for (WebElement row : rows) {
......
......@@ -154,7 +154,7 @@ public class ExtentTestNGIReporterListener implements IReporter {
name= name.substring(0,49)+"...";
}
}else{
name = result.getMethod().getMethodName();
name = result.getMethod().getDescription();
}
if(extenttest==null){
test = extent.createTest(name);
......@@ -162,8 +162,8 @@ public class ExtentTestNGIReporterListener implements IReporter {
//作为子节点进行创建时,设置同父节点的标签一致,便于报告检索。
test = extenttest.createNode(name).assignCategory(categories);
}
//test.getModel().setDescription(description.toString());
//test = extent.createTest(result.getMethod().getMethodName());
// test.getModel().setDescription(description.toString());
// test = extent.createTest(result.getMethod().getMethodName());
for (String group : result.getMethod().getGroups())
test.assignCategory(group);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论