Commit 20a50fd1 authored by 马博's avatar 马博

add

parent 6e1c9de3
package ui.cases.cms;
import base.DuibaBaseUi;
import http.service.Authorization;
import org.openqa.selenium.WebElement;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.Test;
import ui.service.CmsLoginPage;
import ui.service.DafuwengLogin;
import java.util.List;
/**
* Created by mabo on 2019/7/26
*/
public class 积分_Cms_ui extends DuibaBaseUi{
@Autowired
Authorization authorization;
@Autowired
CmsLoginPage cmsLoginPage;
@Autowired
DafuwengLogin dafuwengLogin;
@Test(description = "组件配置")
public void A() throws Exception {
logger.info(driver.toString());
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test11");
sleep(2);
clickByTextEqual("积分");
sleep(2);
clickByTextEqual("+",2);
clickByTextEqual("100x100 2.png");
clickByTextEqual("保存",1);
clickByTextEqual("+",3);
clickByTextEqual("100x100 2.png");
clickByTextEqual("保存",1);
scrollToTop();
clickByTextEqual("保存",0);
sleep(4);
scrollToTop();
clickByTextEqual("发布");
sleep(10);
screenshot();
}
@Test(description = "手机端")
public void B() throws Exception {
String url = "http://wechat.duiba.com.cn/dbredirect/dafuweng?dbredirect=%2F%2Factivity.m.duibatest.com.cn%2Fchw%2Fvisual-editor%2Fskins%3Fid%3D390";
dafuwengLogin.init(6926,url,this);
sleep(2);
Assert.assertTrue(isExistByText("兑换记录"));
Assert.assertTrue(isExistByText("积分"));
clickByTextEqual("兑换记录");
String title = driver.getTitle();
Assert.assertEquals(title,"兑换记录");
driver.navigate().back();
screenshot();
}
@Test(description = "删除楼层")
public void C() throws Exception {
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test11");
sleep(2);
//选中组件
clickByClass("plugin-content-hover",1);
sleep(1);
//点击删除
clickByClass("plugin-delete-icon common-cursor-pointer iconfont-handle handle-guanbi el-popover__reference",1);
sleep(1);
clickByTextEqual("确定",1);
sleep(1);
clickByTextContains("保存");
sleep(4);
scrollToTop();
clickByTextEqual("发布");
sleep(2);
screenshot();
}
}
package ui.cases.cms;
import base.DuibaBaseUi;
import http.service.Authorization;
import org.openqa.selenium.WebElement;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.Test;
import ui.service.CmsLoginPage;
import ui.service.DafuwengLogin;
import java.util.List;
/**
* Created by mabo on 2019/7/24
*/
public class 轮播图_Cms_ui extends DuibaBaseUi{
@Autowired
Authorization authorization;
@Autowired
CmsLoginPage cmsLoginPage;
@Autowired
DafuwengLogin dafuwengLogin;
@Test(description = "组件配置")
public void A() throws Exception {
logger.info(driver.toString());
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test7");
sleep(2);
clickByTextEqual("轮播图");
sleep(2);
clickByTextEqual("添加图片",0);
clickByTextEqual("1.png");
clickByTextEqual("保存",1);
clickByTextContains("添加轮播图");
clickByTextEqual("添加图片",1);
clickByTextEqual("1.png");
clickByTextEqual("保存",1);
clickByTextContains("添加轮播图");
clickByTextEqual("添加图片",2);
clickByTextEqual("1.png");
clickByTextEqual("保存",1);
clickByTextEqual("添加跳转链接",0);
inputByContainsAttribut("placeholder","请输入无线链接","input","http://www.baidu.com");
sleep(2);
clickByXpath("//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary el-button--medium']");
clickByTextEqual("添加跳转链接",0);
sleep(2);
clickByXpath("//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary el-button--medium']");
sleep(1);
clickByTextEqual("添加跳转链接",0);
sleep(2);
clickByXpath("//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary el-button--medium']");
sleep(1);
scrollToTop();
clickByTextEqual("保存",0);
sleep(4);
scrollToTop();
clickByTextEqual("发布");
sleep(10);
screenshot();
}
@Test(description = "手机端")
public void B() throws Exception {
String url = "http://wechat.duiba.com.cn/dbredirect/dafuweng?dbredirect=%2F%2Factivity.m.duibatest.com.cn%2Fchw%2Fvisual-editor%2Fskins%3Fid%3D353";
dafuwengLogin.init(6926,url,this);
sleep(2);
List<WebElement> lists = driver.findElementsByXPath("//*[@class=\"swiper-pagination swiper-pagination-bullets\"]/span");
Assert.assertEquals(lists.size(),3,"校验数量错误");
lists.get(0).click();
String title = driver.getTitle();
Assert.assertEquals(title,"百度一下,你就知道");
driver.navigate().back();
screenshot();
}
@Test(description = "删除楼层")
public void C() throws Exception {
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test7");
sleep(2);
//选中组件
clickByClass("plugin-content-hover",1);
sleep(1);
//点击删除
clickByClass("plugin-delete-icon common-cursor-pointer iconfont-handle handle-guanbi el-popover__reference",1);
sleep(1);
clickByTextEqual("确定",1);
sleep(1);
clickByTextContains("保存");
sleep(4);
scrollToTop();
clickByTextEqual("发布");
sleep(2);
screenshot();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment