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

完成了,重置测试,增删改成功测试

上级 80bc519c
......@@ -181,6 +181,7 @@ public class ConferenceActive {
@Test(description = "重置按钮测试")
public void resetTest() {
try {
Thread.sleep(1000);
meetManage();
WebElement form = webDriver.findElement(By.className("top_wrap")).findElement(By.tagName("form"));
List<WebElement> items = form.findElements(By.className("el-form-item"));
......@@ -213,9 +214,47 @@ public class ConferenceActive {
}
}
@Test(description = "新增null会议室")
public void insertNullMeet() {
try {
Thread.sleep(1000);
//点击新增按钮
webDriver.findElement(By.className("from_button_item")).findElement(By.tagName("button")).findElement(By.tagName("span")).click();
//点击保存
webDriver.findElement(By.className("el-dialog__footer")).findElement(By.tagName("span")).findElement(By.cssSelector(".el-button.el-button--primary")).findElement(By.tagName("span")).click();
String text = webDriver.findElement(By.className("el-message__content")).getText();
Assert.assertEquals("请填写具体信息", text);
WebElement form = webDriver.findElement(By.className("el-dialog__body")).findElement(By.tagName("form"));
List<WebElement> requireds = form.findElements(By.cssSelector(".el-form-item.is-error.is-required"));
for (WebElement required : requireds) {
String label = required.findElement(By.className("el-form-item__label")).getText();
String error = required.findElement(By.className("el-form-item__content")).findElement(By.className("el-form-item__error")).getText();
if ("会议室名称:".equals(label)) {
Assert.assertEquals("请输入会议室名称", error);
}
if ("会议室地址:".equals(label)) {
Assert.assertEquals("请输入会议室地址", error);
}
if ("容呐人数:".equals(label)) {
Assert.assertEquals("请输入容纳人数", error);
}
if ("规模:".equals(label)) {
Assert.assertEquals("请输入会议室规模", error);
}
}
} catch (Exception | Error e) {
file();
Assert.fail(e.getMessage());
} finally {
//取消
webDriver.findElement(By.className("el-dialog__footer")).findElement(By.tagName("span")).findElement(By.cssSelector(".el-button.el-button--default")).findElement(By.tagName("span")).click();
}
}
@Test(description = "新增会议室成功")
public void insertMeetSuccess() {
try {
Thread.sleep(1000);
//点击新增按钮
webDriver.findElement(By.className("from_button_item")).findElement(By.tagName("button")).findElement(By.tagName("span")).click();
//新增/编辑框
......@@ -271,6 +310,7 @@ public class ConferenceActive {
@Test(description = "修改会议室成功")
public void updateMeetSuccess() {
try {
Thread.sleep(1000);
WebElement tbody = webDriver.findElement(By.tagName("tbody"));
List<WebElement> trs = tbody.findElements(By.tagName("tr"));
for (WebElement tr : trs) {
......@@ -342,6 +382,7 @@ public class ConferenceActive {
@Test(description = "删除会议室成功")
public void deleteMeetSuccess() {
try {
Thread.sleep(1000);
WebElement tbody = webDriver.findElement(By.tagName("tbody"));
List<WebElement> trs = tbody.findElements(By.tagName("tr"));
for (WebElement tr : trs) {
......
......@@ -16,6 +16,7 @@
<include name="login"/>
<include name="resetTest"/>
<include name="insertNullMeet"/>
<include name="insertMeetSuccess"/>
<include name="updateMeetSuccess"/>
<include name="deleteMeetSuccess"/>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论