Commit b4306a2d authored by 赵然's avatar 赵然

Merge branch 'mabo' of gitlab2.dui88.com:mabo/test-platform into mabo

parents 5ff24184 c8efa2ed
......@@ -33,7 +33,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
@Autowired
MobileService mobileService;
@Test(description = "1个Q币用户兑换限制永久1次")
// @Test(description = "1个Q币用户兑换限制永久1次")
public void Q币用户永久兑换限制测试() throws Exception{
int uid = 7280;
......@@ -84,7 +84,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "2个Q币用户兑换限制每天1次")
// @Test(description = "2个Q币用户兑换限制每天1次")
public void Q币用户每天兑换限制测试() throws Exception{
int uid = 7281;
......@@ -146,7 +146,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "3个Q币用户兑换限制每月1次")
// @Test(description = "3个Q币用户兑换限制每月1次")
public void Q币用户每月兑换限制测试() throws Exception{
int uid = 7282;
......@@ -209,7 +209,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "Q币会员等级限制LV5")
// @Test(description = "Q币会员等级限制LV5")
public void Q币会员等级测试() throws Exception{
int uid = 7282;
......
......@@ -34,7 +34,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
MobileService mobileService;
@Test(description = "1元话费用户兑换限制永久1次")
// @Test(description = "1元话费用户兑换限制永久1次")
public void 话费用户永久兑换限制测试() throws Exception{
int uid = 7280;
......@@ -84,7 +84,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
@Test(description = "2元话费用户兑换限制每天1次")
// @Test(description = "2元话费用户兑换限制每天1次")
public void 话费用户每天兑换限制测试() throws Exception{
int uid = 7281;
......@@ -145,7 +145,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
@Test(description = "10元话费用户兑换限制每月1次")
// @Test(description = "10元话费用户兑换限制每月1次")
public void 话费用户每月兑换限制测试() throws Exception{
int uid = 7282;
......@@ -207,7 +207,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
@Test(description = "话费会员等级限制LV5")
// @Test(description = "话费会员等级限制LV5")
public void 话费会员等级测试() throws Exception{
int uid = 7282;
......
......@@ -39,7 +39,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
MobileService mobileService;
@Test(description = "1元支付宝用户兑换限制永久1次")
// @Test(description = "1元支付宝用户兑换限制永久1次")
public void 支付宝用户永久兑换限制测试() throws Exception{
int uid = 7262;
......@@ -89,7 +89,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "2元支付宝用户兑换限制每天1次")
// @Test(description = "2元支付宝用户兑换限制每天1次")
public void 支付宝用户每天兑换限制测试() throws Exception{
int uid = 7270;
......@@ -150,7 +150,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "3元支付宝用户兑换限制每月1次")
// @Test(description = "3元支付宝用户兑换限制每月1次")
public void 支付宝用户每月兑换限制测试() throws Exception{
int uid = 7271;
......@@ -212,7 +212,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
@Test(description = "支付宝会员等级限制LV5")
// @Test(description = "支付宝会员等级限制LV5")
public void 支付宝会员等级测试() throws Exception{
int uid = 7271;
......
......@@ -449,19 +449,18 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
@Test(description = "新实物确认下单页面")
public void 实物确认下单测试() throws Exception{
int uid = 7284;
String appItemId = "196093";
String appSkuId = "154";
String appItemId = "196218";
String appSkuId = "145";
Response response = gawService.confirmItemDetail(uid,appItemId,appSkuId);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("data.items[0].sku.attr[0].value"),"白色","校验sku信息颜色失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].sku.attr[1].value"),"S","校验sku信息尺寸失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].sku.credits"),"200","校验sku商品积分失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].multiImage"),"//yun.dui88.com/images/201905/h8x0e1talx.png","校验图片信息失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].sku.credits"),"100","校验sku商品积分失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].multiImage"),"//yun.dui88.com/images/201906/9p72lmu1qn.jpg","校验图片信息失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].title"),"【自动化勿动】自有实物sku","校验实物名称失败");
Assert.assertEquals(response.jsonPath().getString("data.orderCredits"),"200","校验订单积分失败");
Assert.assertEquals(response.jsonPath().getString("data.orderCredits"),"100","校验订单积分失败");
Assert.assertEquals(response.jsonPath().getString("data.expressPrice"),"500","校验订单运费金额失败");
Assert.assertEquals(response.jsonPath().getString("data.consumerPayPrice"),"500","校验订单支付金额失败");
......@@ -475,4 +474,5 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
......@@ -42,7 +42,6 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
return result;
}
@BeforeMethod
public void beforeMethod(){
try {
......@@ -378,4 +377,51 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
logger.info("校验自有新实物---会员兑换制成功");
}
//测试使用
//@Test(enabled=true, dataProvider="testdp", threadPoolSize=1, invocationCount=100)
@DataProvider(name = "testdp", parallel = true)
public static Object[][]testdp(){
return new Object[][]{
{1},
{2},
{3},
{4},
{162},
{6},
{8},
{10},
{157},
{158}
};
}
// @Test(enabled=true, dataProvider="testdp", threadPoolSize=1, invocationCount=100)
public void test(int uid) throws Exception {
// System.out.println("Current Thread Id: " + Thread.currentThread().getId() + ". Dataprovider number: "+ dpNumber);
// Thread.sleep(5000);
String appItemId = "159040";
String itemId = "null";
String message = "";
String skuId="144";
String actualCredits="8";
String credits="100";
Thread.sleep(4000);
Response response = gawService.objectExchange(uid,appItemId,itemId,skuId,credits,actualCredits);
response.prettyPrint();
//(enabled=true, dataProvider="testdp", threadPoolSize=1, invocationCount=2)
String orderId = response.jsonPath().getString("data.orderId");
response = tawService.orderStatus(orderId,uid);
response.prettyPrint();
}
}
package http.service;
import base.AbstractTestNGSpringContextTestsDuiba;
import base.Config;
import base.DuibaBase;
import http.service.app.MobileService;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.lang.reflect.Method;
/**
* Created by mabo on 2018/10/9
*/
@Service
public class testservice {
@ContextConfiguration(classes = Config.class)
public class testservice extends AbstractTestNGSpringContextTestsDuiba {
//数据库用户名
@Value("${db.name}")
String USERNAME;
// @Value("${db.name}")
// String USERNAME;
//
// public void test(){
// System.out.println(USERNAME);
// Method method;
//
//
//
// }
@Autowired
http.service.app.gawService gawService;
@Autowired
http.service.app.tawService tawService;
@Autowired
MobileService mobileService;
@Autowired
Authorization authorization;
@DataProvider(name = "testdp", parallel = true)
public static Object[][]testdp(){
return new Object[][]{
{"1"},
{"2"},
{"3"},
{"4"},
{"5"},
{"6"},
{"8"},
{"10"},
{"157"},
{"158"}
};
}
@Test
public void test() throws Exception {
// System.out.println("Current Thread Id: " + Thread.currentThread().getId() + ". Dataprovider number: "+ dpNumber);
// Thread.sleep(5000);
String appItemId = "159040";
String itemId = "null";
String message = "";
String skuId="33";
String actualCredits="8";
String credits="8";
public void test(){
System.out.println(USERNAME);
Method method;
Thread.sleep(3000);
Response response = gawService.objectExchange(1,appItemId,itemId,skuId,credits,actualCredits);
response.prettyPrint();
//(enabled=true, dataProvider="testdp", threadPoolSize=1, invocationCount=2)
}
}
package ui.cases.cms;
import base.DuibaBaseUi;
import http.service.Authorization;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.Keys;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.Test;
import ui.common.WebDriverFactory;
import ui.service.CmsLoginPage;
import ui.service.DafuwengLogin;
import java.util.Map;
import static com.codeborne.selenide.Selenide.open;
import static ui.common.WebDriverType.CHRMOE;
/**
* Created by mabo on 2019/4/10
*/
public class 双列图 extends DuibaBaseUi{
@Autowired
Authorization authorization;
@Autowired
CmsLoginPage cmsLoginPage;
@Autowired
DafuwengLogin dafuwengLogin;
@Test(description = "组件配置")
public void A() throws Exception {
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test");
sleep(2);
clickByTextEqual("双列图");
sleep(2);
clickByTextEqual("添加图片",0);
clickByTextEqual("1.png");
clickByTextEqual("保存");
System.out.println("ok");
clickByTextEqual("添加图片",1);
clickByTextEqual("1.png");
clickByTextEqual("保存");
System.out.println("ok");
clickByTextEqual("添加跳转链接",0);
inputByContainsAttribut("placeholder","请输入无线链接","input","http://www.baidu.com");
sleep(2);
clickByXpath("//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary']");
clickByTextEqual("添加跳转链接",0);
sleep(2);
clickByXpath("//*[@class='decoration-link-footer']/button[@class='el-button el-button--primary']");
sleep(1);
inputByXpath("//*[@placeholder=\"请输入文本,20字以内\"]","test1",0);
inputByXpath("//*[@placeholder=\"请输入文本,20字以内\"]","test2",1);
clickByTextEqual("保存",1);
sleep(4);
scrollToTop();
clickByTextEqual("发布");
sleep(10);
}
@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%3D134";
dafuwengLogin.init(6926,url,this);
sleep(2);
clickByClass("double-row-item_image");
sleep(3);
String title = driver.getTitle();
Assert.assertEquals(title,"百度一下,你就知道");
driver.navigate().back();
sleep(2);
clickByClass("double-row-item_image",1);
sleep(2);
title = driver.getTitle();
Assert.assertEquals(title,"百度一下,你就知道");
url = driver.getCurrentUrl();
driver.navigate().back();
Assert.assertTrue(isExistByText("test1"));
Assert.assertTrue(isExistByText("test2"));
}
@Test(description = "删除楼层")
public void C() throws Exception {
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test");
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);
}
}
package ui.cases.cms;
import base.DuibaBaseUi;
import http.service.Authorization;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.Test;
import ui.service.CmsLoginPage;
import ui.service.DafuwengLogin;
/**
* Created by mabo on 2019/4/15
*/
public class 商品分组 extends DuibaBaseUi{
@Autowired
Authorization authorization;
@Autowired
CmsLoginPage cmsLoginPage;
@Autowired
DafuwengLogin dafuwengLogin;
@Test
public void A() throws Exception {
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test");
sleep(2);
clickByTextEqual("商品分组",1);
sleep(3);
clickByTextContains("选择分组",1);
clickByXpath("//*[@class=\"el-table__row \"]//label");
clickByTextEqual("确 定");
clickByTextContains("选择分组",1);
clickByXpath("//*[@class=\"el-table__row el-table__row--striped \"]//label");
clickByTextEqual("确 定");
inputByXpath("//*[@class=\"el-input el-input--medium\"]//input","test1",0);
inputByXpath("//*[@class=\"el-input el-input--medium\"]//input","test2",1);
clickByTextEqual("保存",1);
sleep(5);
scrollToTop();
clickByTextEqual("发布");
sleep(10);
}
@Test
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%3D134";
dafuwengLogin.init(6926,url,this);
Assert.assertTrue(isExistByText("test1"));
Assert.assertTrue(isExistByText("test2"));
Assert.assertTrue(isExistContainsText("(勿动)新优惠券日期进行中"));
Assert.assertTrue(isExistContainsText("(勿动)新优惠券日期已结束"));
clickByTextContains("(勿动)新优惠券日期已结束");
sleep(2);
String title = driver.getTitle();
Assert.assertEquals(title,"(勿动)新优惠券日期已结束");
driver.navigate().back();
clickByTextEqual("test2");
clickByTextContains("【接口自动化】实物-一直可兑");
sleep(2);
title = driver.getTitle();
Assert.assertEquals(title,"【接口自动化】实物-一直可兑");
}
@Test(description = "删除楼层")
public void C() throws Exception {
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test");
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);
scrollToTop();
clickByTextContains("保存");
sleep(5);
scrollToTop();
clickByTextEqual("发布");
sleep(10);
}
}
package ui.cases.cms;
import base.DuibaBaseUi;
import http.service.Authorization;
import org.openqa.selenium.Cookie;
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.Map;
import static com.codeborne.selenide.Selenide.open;
/**
* Created by mabo on 2019/4/15
*/
public class 活动分组 extends DuibaBaseUi{
@Autowired
Authorization authorization;
@Autowired
CmsLoginPage cmsLoginPage;
@Autowired
DafuwengLogin dafuwengLogin;
@Test(description = "组件配置")
public void A() throws Exception {
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test");
sleep(2);
clickByTextEqual("活动分组");
sleep(3);
clickByTextEqual("选择分组",0);
clickByXpath("//*[@class=\"el-table__row\"]");
clickByTextEqual("确 定");
clickByTextEqual("选择分组",0);
clickByXpath("//*[@class=\"el-table__row\"]");
clickByTextEqual("确 定");
inputByXpath("//*[@class=\"el-input__inner\"]","test1",1);
inputByXpath("//*[@class=\"el-input__inner\"]","test2",3);
clickByTextEqual("保存",1);
sleep(5);
scrollToTop();
clickByTextEqual("发布");
sleep(10);
}
@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%3D134";
dafuwengLogin.init(6926,url,this);
Assert.assertTrue(isExistByText("test1"));
Assert.assertTrue(isExistByText("test2"));
Assert.assertTrue(isExistByText("活动组测试1"));
Assert.assertTrue(isExistByText("活动组测试2"));
clickByTextEqual("活动组测试1");
sleep(2);
String title = driver.getTitle();
Assert.assertEquals(title,"活动组测试1");
driver.navigate().back();
clickByTextEqual("test2");
clickByTextEqual("活动组测试2",1);
sleep(2);
title = driver.getTitle();
Assert.assertEquals(title,"活动组测试2");
}
@Test(description = "删除楼层")
public void C() throws Exception {
cmsLoginPage.init("15968831723",this);
clickByTextEqual("test");
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);
scrollToTop();
clickByTextContains("保存");
sleep(5);
clickByTextEqual("发布");
sleep(10);
}
}
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