提交 b189e78b authored 作者: mry's avatar mry

test(初始测试):初始自动测试

上级 3e239cf2
package com.tykj.selenium;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.testng.TestNG;
import java.util.ArrayList;
import java.util.List;
@SpringBootApplication
public class SeleniumApplication {
public static void main(String[] args) {
SpringApplication.run(SeleniumApplication.class, args);
List<String> suites = new ArrayList<String>();
suites.add("testng.xml");
TestNG testNG = new TestNG();
testNG.setTestSuites(suites);
testNG.run();
}
}
......@@ -7,8 +7,10 @@ import org.apache.commons.io.FileUtils;
import org.openqa.selenium.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.testng.Assert;
import org.testng.Reporter;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
import java.io.File;
import java.io.IOException;
......@@ -37,13 +39,34 @@ public class ConferenceActive {
Reporter.log("<img src=/opt/conference_manage_deploy/images/" + fileName + " style=width:30px;height:30px />", true);
}
@BeforeClass
public void url(){
public void login(String username, String password) {
//todo 这个系统暂时没有登录的功能
}
@Test
//进入页面
public void url(){
webDriver.get(baseUrl);
webDriver.manage().window().maximize();
webDriver.findElement(By.className("router_nav")).click();
}
public void login(String username, String password) {
//todo 这个系统暂时没有登录的功能
// @Test(description = "新增会议室")
// public void insertMeeting(){
//
// }
@AfterClass(alwaysRun = true)
public void quit(){
webDriver.quit();
}
}
......@@ -17,7 +17,7 @@ import java.util.*;
public class ExtentTestNGIReporterListener implements IReporter {
//生成的路径以及文件名
private static final String OUTPUT_FOLDER = "/opt/conference_manage_deploy/test_report/";
private static final String OUTPUT_FOLDER = "/opt/conference_manage_deploy/reports/";
private static final String FILE_NAME =
new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒的报告").format(new Date()) + ".html";
......
......@@ -11,13 +11,7 @@
<classes>
<class name="com.tykj.selenium.conferenceRoomTest.ConferenceActive"/>
<methods>
<include name="insertConferenceRoomFailAll"/>
<include name="insertConferenceRoomOne"/>
<include name="insertConferenceRoom"/>
<include name="updateConferenceRoom"/>
<include name="findConferenceRoom"/>
<include name="findConferenceRoomNumber"/>
<include name="deleteConferenceRoom"/>
<include name="url"/>
</methods>
</classes>
</test>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论