Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马博
test-platform
Commits
535464a2
Commit
535464a2
authored
Nov 03, 2018
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
43a6f0d8
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
4432 additions
and
0 deletions
+4432
-0
ActiveGroup_FloorTest.java
...test/java/http/cases/FloorTest/ActiveGroup_FloorTest.java
+459
-0
Banner_FloorTest.java
src/test/java/http/cases/FloorTest/Banner_FloorTest.java
+376
-0
Coupon_FloorTest.java
src/test/java/http/cases/FloorTest/Coupon_FloorTest.java
+403
-0
Floor_FloorTest.java
src/test/java/http/cases/FloorTest/Floor_FloorTest.java
+312
-0
Game_FloorTest.java
src/test/java/http/cases/FloorTest/Game_FloorTest.java
+283
-0
Icon_FloorTest.java
src/test/java/http/cases/FloorTest/Icon_FloorTest.java
+423
-0
Item_FloorTest.java
src/test/java/http/cases/FloorTest/Item_FloorTest.java
+415
-0
Seckill_FloorTest.java
src/test/java/http/cases/FloorTest/Seckill_FloorTest.java
+860
-0
Showcase_FloorTest.java
src/test/java/http/cases/FloorTest/Showcase_FloorTest.java
+300
-0
Sign_FloorTest.java
src/test/java/http/cases/FloorTest/Sign_FloorTest.java
+556
-0
StringUtil.java
src/test/java/utils/StringUtil.java
+45
-0
No files found.
src/test/java/http/cases/FloorTest/ActiveGroup_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.ActivityService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevItemService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
/**
* Created by mabo on 2018/6/8
*/
public
class
ActiveGroup_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
@Autowired
DevItemService
devItemService
;
@Autowired
ActivityService
activityService
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
String
skinId
=
null
;
private
String
floorId
=
null
;
@BeforeClass
public
void
beforeClass
(){
try
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤ActiveGroup"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboActiveGroup"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
}
@Test
public
void
A_
创建活动楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"5"
;
String
dataType
=
"2"
;
String
name
=
"maboActiveGroup"
;
String
skinWidth
=
"640"
;
String
html
=
" <section class=\"subpage-item a-fadeinT\">\n"
+
" <div class=\"plays-warp\">\n"
+
" <div class=\"plays-title\"></div>\n"
+
" <div class=\"plays\" id=\"plays\">\n"
+
" {@each list as item, index}\n"
+
" {@if index == 0}\n"
+
" <a href=\"${item.link}\" class=\"play\" db-log=\"${item.stInfo}\" style=\"top:0rem\">\n"
+
" {@/if}\n"
+
" {@if index == 1}\n"
+
" <a href=\"${item.link}\" class=\"play\" db-log=\"${item.stInfo}\" d style=\"top:0.35rem\">\n"
+
" {@/if}\n"
+
" {@if index == 2}\n"
+
" <a href=\"${item.link}\" class=\"play\" db-log=\"${item.stInfo}\" style=\"top:1.625rem\">\n"
+
" {@/if}\n"
+
" {@if index == 3}\n"
+
" <a href=\"${item.link}\" class=\"play\" db-log=\"${item.stInfo}\" style=\"top:1.975rem\">\n"
+
" {@/if}\n"
+
" <img src=\"${!!item.whitethumb?item.whitethumb:item.thumb}\" class=\"play-img\">\n"
+
" <p class=\"play-title\">${item.title}</p>\n"
+
" <div class=\"play-btn\">抽奖</div>\n"
+
" </a>\n"
+
" {@/each}\n"
+
" <div class=\"retry\">加载更多</div>\n"
+
" <!--<div class=\"loading\" style=\"display: block\">\n"
+
" <div></div>\n"
+
" </div>-->\n"
+
" <div class=\"nomore\" display>没有更多了</div>\n"
+
" </div>\n"
+
" </div>\n"
+
" </section>"
;
String
css
=
".plays-warp {\n"
+
" position: relative;\n"
+
" width: 3.2rem;\n"
+
" margin-top: 0.05rem;\n"
+
"}\n"
+
".plays-warp .plays {\n"
+
" width: 100%;\n"
+
" height: 100%;\n"
+
"}\n"
+
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ZfIObpu9xPbZ94hLNTUADpUm0J3DD6sn5oaN4yQgYsbAh+HhFZ0k+K+rgnLBt6HY3REDtDRY1t6H07Wk5BcslSpYKblbe/DlVr34cJa78OpWWqiVKkkuQMQGnAfTnfMk1QDc46ZwmE7SXk4XaViJlJ5z8BgvW7f6nctoKEiupnXG2PJUI/FHptJhirooGYAdF9O9a3rNmRIt2AARyVDE+/Djdj2iiL3ygjTUDkwpKkq9SK5OKpSM+z24SikrpPq3n4fbkwb+3BUM2RbDJUdXNBxSz/p1i1JRcTBUXWv+kkHWW9teDUH14/+yMHv+ChjQ90Tq9B5x81EZPtOCrrQboSOf7XIkFf5gTeq7yH5HbFtP+ruFaQ3Yj71k3ZaHtuieFrMDzVQDqdXzHmpS0KqT+k99uECrftwMqNR+3C62lKCk+H9HEvZoCPqTV1skYO7h1uzv360vePfLXOds5DhjaC2PetnxqVuncqGyugqKugX2QwJDpZfLbJaHmmg4n7EK8IN0enfZlNo5iKygpmRoRq/Znlv7sNxmaq45RE5WhfBoiHQsg+XaLcPt8RmH84upK5R1dbNm6r1Kw1MLlNNgVXaVazm9aO//Hn7dm3+TqP/BzvlhJ7D8dyXAAAAAElFTkSuQmCC\");\n"
+
" background-repeat: no-repeat;\n"
+
" background-size: 100% 100%;\n"
+
"}\n"
+
".plays-warp .play {\n"
+
" position: absolute;\n"
+
" z-index: 1;\n"
+
" width: 1.575rem;\n"
+
" height: 1.575rem;\n"
+
" background-color: #fff;\n"
+
"}\n"
+
".plays-warp .play .play-img {\n"
+
" width: 1.475rem;\n"
+
" height: 0.92rem;\n"
+
" margin: 0.05rem 0.05rem 0 0.05rem;\n"
+
"}\n"
+
".plays-warp .play .play-title {\n"
+
" width: 1.2rem;\n"
+
" margin: 0.1rem auto 0;\n"
+
" font-size: 0.12rem;\n"
+
" text-align: center;\n"
+
" padding: 0.01rem;\n"
+
" text-overflow: ellipsis;\n"
+
" white-space: nowrap;\n"
+
" overflow: hidden;\n"
+
"}\n"
+
".plays-warp .play .play-btn {\n"
+
" display: block;\n"
+
" margin: 0.075rem auto 0;\n"
+
" width: 0.42rem;\n"
+
" height: 0.19rem;\n"
+
" background-color: #ee2b0f;\n"
+
" text-align: center;\n"
+
" line-height: 0.2rem;\n"
+
" color: #ffffff;\n"
+
" font-size: 0.11rem;\n"
+
" border-radius: 0.095rem;\n"
+
"}\n"
+
".plays-warp .play:nth-child(2n) {\n"
+
" position: absolute;\n"
+
" top: 0.35rem;\n"
+
" width: 1.575rem;\n"
+
" height: 1.575rem;\n"
+
"}\n"
+
".plays-warp .play:nth-child(2n+1) {\n"
+
" position: absolute;\n"
+
" width: 1.575rem;\n"
+
" height: 1.575rem;\n"
+
" left: 1.625rem;\n"
+
"}\n"
+
".plays-warp .play:nth-child(5)::after {\n"
+
" position: absolute;\n"
+
" z-index: 1;\n"
+
" content: '';\n"
+
" display: inline-block;\n"
+
" width: 0.235rem;\n"
+
" height: 0.26rem;\n"
+
" right: 0.1rem;\n"
+
" top: 0.1rem;\n"
+
" background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAA0CAMAAAAt6JHGAAAABGdBTUEAALGPC/xhBQAAAhlQTFRF/0ND/0JC/0ND/0RE/0JC/0ND/0RE/2Bg/0ND/0ND/0RE/0VF/0RE/0ND/0JC/0JC/0ZG/0JC/0JC/0ND/0JC/0ND/0ND/0lJ/0ND/0JC/0JC/0RE/0ND/0ND/0RE/0JC/0RE/0VF/0JC/0RE/0ND/0ZG/0ZG/0ND/0ND/0ND/0hI/0JC/////0JC/0JC/0ND/0JC/0JC/0ND/0ND/0ND/0lJ/0ND/0ND/0ND/0ND/0ND/0RE/0ND/0ND/0ND/0ND/0RE/0RE/0ND/0ND/0RE/0VF/0JC/1BQ/05O/0RE/0JC/0ND/0JC/0JC/0RE/0RE/0RE/0VF/0pK/0ND/0JC/0RE/0ND/0ND/0RE/0JC/0ND/0VF/0VF/0ND/0ZG/0ND/0ND/0ND/1VV/0RE/0JC/0ND/0RE/0Z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+jU+kF2SPhg+ElJqRmit1nJ9YAXKd8KdiAw/hgPdfzkwCyIVgPtmvFtYHt0828ElnrVx0XAVo3fC7ZZ59vmAFvU/G0H1mrmUwS2Rr/+CUBSRyulLAYWujTjjyr5Oanz1l3KeyfN56eQSN4pf/ig4hP1+eDfJtZqwXrS+Hye/047+dzuPLWjwO32iJXftGFF7hJTII3z3e4U3laq+7dPNvt7RX3e75D09wP1vECOP5iq/915UpvXEjwv0nskis/jsPP3Y3w/gPDz+mk8XgiNx4A3Js/oj/B4FqPqWh8Ft0fofGwfj8Yf1sDAY+hJtZFuM2fD0AMV185F6rKbdzQ3gIj7Q3/NmbMhbCupHIm4XxjcT2rPm4vqk48NHHUaXHH+AWsCTuVQ6BInAAAAAElFTkSuQmCC\");\n"
+
" background-repeat: no-repeat;\n"
+
" background-size: 100% 100%;\n"
+
"}\n"
+
".plays-warp .play:nth-child(6)::after {\n"
+
" position: absolute;\n"
+
" content: '';\n"
+
" display: inline-block;\n"
+
" width: 0.26rem;\n"
+
" height: 0.28rem;\n"
+
" right: 0.1rem;\n"
+
" top: 0.1rem;\n"
+
" background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA4CAMAAACFZCuiAAAABGdBTUEAALGPC/xhBQAAAYxQTFRFz2D/zlL/z1j/zVH/zlP/zFL/zlL/zFD/zVP/zFH/zlH/zVH/zFH/zFD/zFH/zVH/zFD/zlH/zVP/zFH/zFH/zFD/z1P/zFH/zVH/zFH/zVD/0VX/zlP/zVT/zVH/zVD/zFD/0lr/zFH/zlH/zVP/zVD/z1L/zVD/zFD/0VX/zFH/zFD/zGb/zFH/zFH/zFL/zVD/zFD/zlL/zFH/z1L/zFL/zFP/zVD/zlL/zFH/zVH/zVD/zVH/zlH/zFL/zVH/zVH/0VH/zFH/zVD/zVH//4D/zlX/0VH/zVH/zFH/////zVH/zVD/zFH/zFH/zVL/zFH/zVH/zFX/0FX/1VX//1X/1VX/0V3/zVD/zlL/zVL/zVH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KkIBOA3kYCUEg13px6Uitm1dOnb1A9UfOneklQR2pafAimFMsckw9qBZXFvErpJulttUj8OvHp45DdHm8kVcpR37cvK4ufB0THSN+SKb3cRaqD+9ULIb1Wk4C3Ij+MqUrA1pu8uoT+BbvxDyUHlVFU5Tj1AAAAAElFTkSuQmCC\");\n"
+
" background-repeat: no-repeat;\n"
+
" background-size: 100% 100%;\n"
+
"}\n"
+
".plays-warp .retry,\n"
+
".plays-warp .loading,\n"
+
".plays-warp .nomore {\n"
+
" position: absolute;\n"
+
" z-index: 0;\n"
+
" display: none;\n"
+
" width: 1.575rem;\n"
+
" height: 0.3rem;\n"
+
" bottom: 0.05rem;\n"
+
" right: 0;\n"
+
" color: #888888;\n"
+
" font-size: 0.12rem;\n"
+
" text-align: center;\n"
+
" line-height: 0.3rem;\n"
+
"}"
;
String
js
=
" if(data && data.list && data.list.length > 1) {\n"
+
"\t// 爱奇艺定制去掉游戏\n"
+
"\tif (global.appId == 31819) {\n"
+
"\t \tvar _list = [];\n"
+
"\t\tdata.list.forEach(function(item, index) {\n"
+
"\t\t if(item.activityType !== 28 && item.activityType !== 46 && item.activityType !== 47) {\n"
+
"\t\t\t_list.push(item)\n"
+
"\t\t }\n"
+
"\t\t});\n"
+
"\t \tdata.list = _list;\n"
+
"\t}\n"
+
"\t//初次显示的数据\n"
+
" var showData = {};\n"
+
" var isFirst = true;\n"
+
" //点击更多显示的数据\n"
+
" var dat = [];\n"
+
" //数据索引\n"
+
" var pageIndex = 4;\n"
+
" //计算高度,top\n"
+
" var playHeight = 315;\n"
+
" var initHeight = [3.25, 3.6];\n"
+
" showData.list = data.list.splice(0,4);\n"
+
" if (showData.list.length == 3 ) {\n"
+
" showData.list.splice(2,1); \n"
+
" }\n"
+
" dat = showData.list;\n"
+
" // yangzuo.extend(data, global);\n"
+
"\t console.log(showData);\n"
+
" $(\"#renderRoot\").append(juicer(html, showData));\n"
+
" // 显示是否还有\n"
+
" var $retry = $('.retry');\n"
+
" var $nomore = $('.nomore');\n"
+
" var $plays = $('#plays');\n"
+
"\t var $retry = $('.retry');\n"
+
" var showDataLen = data.list.length;\n"
+
" var totalLen = data.list.length;\n"
+
" //容器高度\n"
+
" function warpPlayHeight() {\n"
+
" totalLen = 4 * (pageIndex / 4 - 1) + dat.length; \n"
+
" if (totalLen < 3) {\n"
+
" $plays.height('1.925rem'); \n"
+
" } else if (totalLen < 5) {\n"
+
" $plays.height('3.55rem'); \n"
+
" } else {\n"
+
" if (dat.length == 0){\n"
+
" $plays.height((totalLen/4-1) * 3.25 + 3.55 - 1.625+\"rem\");\n"
+
" } else {\n"
+
" $plays.height((totalLen /4-1) * 3.25 + 3.55+ \"rem\"); \n"
+
" }\n"
+
" if (dat.length < 4 && data.list.length < 4) {\n"
+
" $retry.hide();\n"
+
" $nomore.show();\n"
+
" console.log('没有更多了');\n"
+
" return false;\n"
+
" }\n"
+
" }\n"
+
" }\n"
+
" warpPlayHeight();\n"
+
" // 显示更多 或者 没有更多\n"
+
" function hasMore() {\n"
+
" console.log(data.list.length);\n"
+
" if (isFirst){\n"
+
" console.log(showData.list, isFirst);\n"
+
" if (showData.list.length < 4){\n"
+
" $retry.hide();\n"
+
" $nomore.show();\n"
+
" isFirst = false;\n"
+
" return false;\n"
+
" } else {\n"
+
" $nomore.hide();\n"
+
" $retry.show();\n"
+
" isFirst = false;\n"
+
" return false;\n"
+
" }\n"
+
" }\n"
+
" if (dat.length < 4 || data.list.length == 1 || data.list.length == 0){\n"
+
" $retry.hide();\n"
+
" $nomore.show();\n"
+
" } else {\n"
+
" $nomore.hide();\n"
+
" $retry.show();\n"
+
" }\n"
+
" }\n"
+
" hasMore();\n"
+
" function getMore() {\n"
+
" dat = data.list.splice(0, 4);\n"
+
" pageIndex += 4; \n"
+
" if (dat.length == 3){\n"
+
" dat.length = 2;\n"
+
" dat.splice(2,1);\n"
+
" } \n"
+
" if (dat.length == 1) {\n"
+
" dat.length = 0;\n"
+
" dat.splice(0, 1);\n"
+
" return false;\n"
+
" }\n"
+
" warpPlayHeight();\n"
+
" for(var i = 0; i < dat.length; i++) {\n"
+
"\t\t\t \t\t var _img = dat[i].whitethumb ? dat[i].whitethumb : dat[i].thumb;\n"
+
" $newPlay = $(\"<a href='\" + dat[i].link + \"' class='play' db-log='\" + dat[i].stInfo + \"' db-buttonType='20025'>\" +\n"
+
" \"<img src='\" + _img + \"' class='play-img'>\" +\n"
+
" \"<p class='play-title'>\" + dat[i].title + \"</p>\" +\n"
+
" \"<div class='play-btn'>抽奖</div>\" +\n"
+
" \"</a>\");\n"
+
" $retry.before($newPlay);\n"
+
" var itemNum = i % 2;\n"
+
" if(i < 2){\n"
+
" var playTop = initHeight[itemNum];\n"
+
" } else {\n"
+
" var playTop = initHeight[itemNum] + 1.625;\n"
+
" }\n"
+
" $newPlay.css('top', playTop+'rem');\n"
+
"\t\t\t window.DB && window.DB.statistics && window.DB.statistics.initLog();\n"
+
" }\n"
+
" hasMore();\n"
+
" initHeight[0] = initHeight[0] +3.25;\n"
+
" initHeight[1] = initHeight[1] + 3.25;\n"
+
" }\n"
+
" $('.retry').on('click', function(){\n"
+
" getMore();\n"
+
" });\n"
+
"\tvar show = false;\n"
+
" function isShow() {\n"
+
" var st = $('.retry').offset().top;\n"
+
" var wt = $('body').scrollTop();\n"
+
" var wh = $(window).height();\n"
+
" show = wt > (st - wh - 20) ? true : false;\n"
+
" };\n"
+
" $(document).scroll(function(){\n"
+
" isShow();\n"
+
" if (show && $('.retry').width() > 0){\n"
+
" getMore();\n"
+
" show = false;\n"
+
" } \n"
+
" });\n"
+
" }"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
response
.
prettyPrint
();
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤ActiveGroup"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
// 验证码
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
"5"
);
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
response
.
prettyPrint
();
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
response
.
prettyPrint
();
}
@Test
public
void
B_
手机端活动
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
Thread
.
sleep
(
60000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
// response = devItemService.appItems(authorization.hdLoginmabo(),"18740");
response
=
activityService
.
list2
(
authorization
.
hdLoginmabo
(),
"18740"
);
response
.
prettyPrint
();
List
<
Map
>
maplist
=
response
.
jsonPath
().
getList
(
"data.list"
,
Map
.
class
);
int
size
=
maplist
.
size
();
for
(
int
i
=
0
;
i
<
maplist
.
size
();
i
++){
if
(
maplist
.
get
(
i
).
get
(
"status"
).
toString
().
equals
(
"1"
)){
size
--;
}
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
response
.
asString
());
String
data
=
jsonObject
.
getString
(
"data"
);
List
listDev
=
JSONObject
.
parseObject
(
data
).
getJSONArray
(
"list"
);
Assert
.
assertEquals
(
list
.
size
(),
size
,
"活动数量不正确"
);
}
@Test
public
void
C_
删除活动楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/devSkin/saveSkin接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/devSkin/saveSkin接口失败,返回信息:"
+
response
.
asString
());
}
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
}
src/test/java/http/cases/FloorTest/Banner_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
public
class
Banner_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
private
String
skinId
=
null
;
private
String
floorId
=
null
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@BeforeClass
public
void
beforeClass
(){
try
{
List
<
Map
>
list
=
devFloorBannerService
.
selectedList
(
authorization
.
hdLoginmabo
(),
"18740"
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
Map
map
=
list
.
get
(
i
);
String
bannerId
=
String
.
valueOf
(
map
.
get
(
"bannerId"
));
devFloorBannerService
.
delBanner
(
authorization
.
hdLoginmabo
(),
"18740"
,
bannerId
);
}
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤banner"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboTest楼层banner"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
}
@Test
public
void
A_
创建
banner
楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"1"
;
String
dataType
=
"0"
;
String
name
=
"maboTest楼层banner"
;
String
skinWidth
=
"640"
;
String
html
=
"<section class=\"floor-banner a-fadeinT\">\n"
+
" <div class=\"J_bannerSwiper swiper-container\">\n"
+
" <div id=\"J_bannerList\" class=\"swiper-wrapper\">\n"
+
" {@each list as item}\n"
+
" \t<div class=\"swiper-slide\">\n"
+
" <a href=\"${item.link}\" target=\"_top\">\n"
+
" <img alt=\"${item.title}\" data-src=\"${item.image}\" class=\"swiper-lazy\"/>\n"
+
" <div class=\"swiper-lazy-preloader swiper-lazy-preloader-white\"></div>\n"
+
" </a>\n"
+
" \t</div>\n"
+
" {@/each}\n"
+
" </div>\n"
+
" <div class=\"swiper-pagination\"></div>\n"
+
" </div>\n"
+
"</section>"
;
String
css
=
".floor-banner {\n"
+
" width: 3.2rem;\n"
+
" height: 1.4rem;\n"
+
" overflow: hidden;\n"
+
"}\n"
+
".swiper-container {\n"
+
" height: 100%;\n"
+
"}\n"
+
".swiper-container-horizontal > .swiper-pagination {\n"
+
" bottom: 0.05rem;\n"
+
"}"
;
String
js
=
"if (data && data.list && data.list.length) {\n"
+
"\t$(\"#renderRoot\").append(juicer(html, data));\n"
+
"\tnew Swiper('.J_bannerSwiper', {\n"
+
"\t\tloop: true,\n"
+
"\t\tautoplay: 3000,\n"
+
"\t\tautoplayDisableOnInteraction: false,\n"
+
"\t\tpagination: '.J_bannerSwiper .swiper-pagination',\n"
+
"\t\tpaginationClickable: true,\n"
+
"\t\tpreloadImages: false,\n"
+
"\t\tlazyLoading: true\n"
+
"\t});\n"
+
"}"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤banner"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
map
.
get
(
"floor_type"
));
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
public
void
B_banner
楼层活动校验
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
response
=
devFloorBannerService
.
activityList
(
authorization
.
hdLoginmabo
(),
"18740"
,
""
);
response
.
prettyPrint
();
JSONObject
json
=
new
JSONObject
();
json
.
putAll
(
getByName
(
response
.
jsonPath
().
getList
(
"data"
),
"【自动化】出奖虚拟商品"
));
json
.
put
(
"appId"
,
18740
);
json
.
put
(
"new"
,
false
);
json
.
put
(
"selected"
,
false
);
json
.
put
(
"show"
,
true
);
devFloorBannerService
.
saveActivityBanner
(
authorization
.
hdLoginmabo
(),
json
.
toJSONString
()).
prettyPrint
();
Thread
.
sleep
(
60000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
Map
map
=
getByName
(
list
,
"【自动化】出奖虚拟商品"
);
Assert
.
assertNotNull
(
map
,
"banner里没有该商品"
);
String
title
=
(
String
)
map
.
get
(
"title"
);
String
activityId
=
String
.
valueOf
(
map
.
get
(
"activityId"
));
String
link
=
(
String
)
map
.
get
(
"link"
);
String
image
=
(
String
)
map
.
get
(
"image"
);
String
sourceType
=
String
.
valueOf
(
map
.
get
(
"sourceType"
));
Assert
.
assertEquals
(
image
,
"//yun.duiba.com.cn/h5/activity/drawLot/drawLot/assets/640-280.png"
,
""
);
// Assert.assertEquals(link,"//activity.m.duibatest.com.cn/newtools/index?id=21344&dbnewopen&dpm=18740.5.231.3&dcm=202.21344.0.0","");
Assert
.
assertEquals
(
title
,
"【自动化】出奖虚拟商品"
,
""
);
Assert
.
assertEquals
(
sourceType
,
"13"
,
""
);
Assert
.
assertEquals
(
activityId
,
"21344"
,
""
);
}
@Test
public
void
C_banner
商品校验
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devFloorBannerService
.
itemList
(
authorization
.
hdLoginmabo
(),
"18740"
,
""
);
response
.
prettyPrint
();
JSONObject
json
=
new
JSONObject
();
json
.
putAll
(
getByName
(
response
.
jsonPath
().
getList
(
"data"
),
"mabo自动化实物"
));
json
.
put
(
"appId"
,
18740
);
json
.
put
(
"new"
,
false
);
json
.
put
(
"selected"
,
false
);
json
.
put
(
"show"
,
true
);
devFloorBannerService
.
saveItemBanner
(
authorization
.
hdLoginmabo
(),
json
.
toJSONString
()).
prettyPrint
();
Thread
.
sleep
(
62000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
response
.
prettyPrint
();
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
Map
map
=
getByName
(
list
,
"mabo自动化实物"
);
Assert
.
assertNotNull
(
map
,
"banner里没有该商品"
);
String
title
=
(
String
)
map
.
get
(
"title"
);
String
appItemId
=
String
.
valueOf
(
map
.
get
(
"appItemId"
));
String
link
=
(
String
)
map
.
get
(
"link"
);
String
image
=
(
String
)
map
.
get
(
"image"
);
String
sourceType
=
String
.
valueOf
(
map
.
get
(
"sourceType"
));
Assert
.
assertEquals
(
image
,
"//yun.dui88.com/images/201805/7mwt22vdfu.jpg"
,
""
);
// Assert.assertEquals(link,"//goods.m.duibatest.com.cn/mobile/appItemDetail?appItemId=163948&dbnewopen&dpm=18740.5.231.2&dcm=102.163948.0.0","");
Assert
.
assertEquals
(
title
,
"mabo自动化实物"
,
""
);
Assert
.
assertEquals
(
sourceType
,
"0"
,
""
);
Assert
.
assertEquals
(
appItemId
,
"163948"
,
""
);
}
@Test
public
void
D_banner
自定义外链接
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
appId
=
"18740"
;
String
bannerImgNew
=
""
;
String
img
=
"//yun.dui88.com/images/201805/hdgasav66e.jpg"
;
String
title
=
"banner上传自动化测试"
;
String
url
=
"http://www.baidu.com"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"appId"
,
appId
);
json
.
put
(
"bannerImgNew"
,
bannerImgNew
);
json
.
put
(
"img"
,
img
);
json
.
put
(
"title"
,
title
);
json
.
put
(
"url"
,
url
);
devFloorBannerService
.
uploadBanner
(
authorization
.
hdLoginmabo
(),
json
.
toJSONString
()).
prettyPrint
();
Thread
.
sleep
(
60000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
Response
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
Map
map
=
getByName
(
list
,
"banner上传自动化测试"
);
Assert
.
assertNotNull
(
map
,
"banner里没有该商品"
);
title
=
(
String
)
map
.
get
(
"title"
);
String
sourceType
=
String
.
valueOf
(
map
.
get
(
"sourceType"
));
String
link
=
(
String
)
map
.
get
(
"link"
);
String
image
=
(
String
)
map
.
get
(
"image"
);
Assert
.
assertEquals
(
image
,
"//yun.dui88.com/images/201805/hdgasav66e.jpg"
,
""
);
// Assert.assertEquals(link,"//home.m.duibatest.com.cn/log/redirect?url=http%3A%2F%2Fwww.baidu.com%3Fdbtodeveloper%26uid%3D2753%26dbnewopen&dpm=18740.5.231.1&dcm=","");
Assert
.
assertEquals
(
title
,
"banner上传自动化测试"
,
""
);
Assert
.
assertEquals
(
sourceType
,
"2"
,
""
);
}
// @Test
public
void
banner
重新上传图片
(){
}
// @Test
public
void
banner
删除第一个
(){
}
// @Test
public
void
banner
展示
(){
}
@Test
public
void
E_
删除
banner
皮肤和楼层
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
List
<
Map
>
list
=
devFloorBannerService
.
selectedList
(
authorization
.
hdLoginmabo
(),
"18740"
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
Map
map
=
list
.
get
(
i
);
String
bannerId
=
String
.
valueOf
(
map
.
get
(
"bannerId"
));
devFloorBannerService
.
delBanner
(
authorization
.
hdLoginmabo
(),
"18740"
,
bannerId
);
}
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
response
.
prettyPrint
();
}
public
Map
getByName
(
List
<
Map
>
list
,
String
name
){
// String s = response.toString();
// JsonPath jsonPath=from(s.substring(s.indexOf("{"),s.length()-1));
// List<Map> list = jsonPath.getList("list",Map.class);
for
(
Map
map:
list
)
{
if
(
map
.
get
(
"title"
).
equals
(
name
))
return
map
;
}
return
null
;
}
//@Test
public
void
test1
(){
Response
response
=
homeService
.
index
(
2753
);
String
html
=
response
.
asString
();
// System.out.println(html);
String
find
=
"var CfG={(.*?)"
;
System
.
out
.
println
(
MatcherString
.
getString
(
html
,
find
,
1
));
}
}
src/test/java/http/cases/FloorTest/Coupon_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevFloorChildPageService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
/**
* Created by mabo on 2018/6/8
* 优惠券
*/
public
class
Coupon_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
@Autowired
DevFloorChildPageService
devFloorChildPageService
;
private
String
skinId
=
null
;
private
String
floorId
=
null
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@BeforeClass
public
void
beforeClass
(){
try
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤conpon"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboConpon"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
}
@Test
public
void
A_
创建优惠券楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"6"
;
String
dataType
=
"0"
;
String
name
=
"maboConpon"
;
String
skinWidth
=
"750"
;
String
html
=
"<div class=\"floor-coupon a-fadeinT\">\n"
+
" <div class=\"title\">\n"
+
" <div class=\"name\"><i></i>优惠券</div>\n"
+
" <a class=\"more\" href=\"${moreLink}\">更多<i></i></a>\n"
+
" </div>\n"
+
" <div class=\"item-con\">\n"
+
" <div class=\"scroll\">\n"
+
" <div class=\"scroll-x\" id =\"floor-coupon-scroll\">\n"
+
" {@each list as item}\n"
+
" <a class=\"item\" href=\"${item.link}\">\n"
+
" <div class=\"fl-a\" db-log=\"${item.stInfo}\">\n"
+
" <div class=\"img-warp\"> \n"
+
" <img src=\"${item.iconImage}\">\n"
+
" </div>\n"
+
" <div class=\"info-warp\">\n"
+
" <p class=\"des\">${item.interestDesc}</p>\n"
+
" <p class=\"subtitle\">${item.subtitle}</p>\n"
+
" </div> \n"
+
" </div>\n"
+
" </a> \n"
+
" {@/each}\n"
+
" <a href=\"${moreLink}\" class=\"more view-more\">\n"
+
" <span>查看更多</span>\n"
+
" </a>\n"
+
" <div class=\"pd-space\"></div>\n"
+
" </div> \n"
+
" </div>\n"
+
" </div>\n"
+
"</div>"
;
String
css
=
".floor-coupon {\n"
+
" padding: 0.125rem 0 0.1rem 0;\n"
+
" margin-bottom: 0.05rem;\n"
+
" background: #ffffff;\n"
+
" display: block;\n"
+
"}\n"
+
".floor-coupon .title {\n"
+
" position: relative;\n"
+
" height: 0.15rem;\n"
+
" line-height: 0.15rem;\n"
+
" margin-bottom: 0.1rem;\n"
+
" margin-left: 0.1rem;\n"
+
" text-align: left;\n"
+
"}\n"
+
".floor-coupon .title .name {\n"
+
" display: inline-block;\n"
+
" font-size: 0.14rem;\n"
+
" color: #444;\n"
+
" line-height: 0.15rem;\n"
+
" margin-right: 0.15rem;\n"
+
"}\n"
+
".floor-coupon .title .name i {\n"
+
" display: inline-block;\n"
+
" vertical-align: top;\n"
+
" margin-right: 0.035rem;\n"
+
" width: 0.15rem;\n"
+
" height: 0.15rem;\n"
+
" background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAaVBMVEUAAAD/pQL/sBL/pQL/pQP/pAL/pgT/pQT/pgT/xTH/pQL/pAL/pQP/pAP/pAP/pQL/pQP/pgP/pAT/qQf/rQn/pQT/pQP/pAP/pQP/pQL/pgP/pgT/pAL/pQP/pgL/pQL/pQP/pQX/pAJMiN/XAAAAInRSTlMA+w7srvONhTkF2djGual3WlA7JhxHwKOYZmJI4cx+cVgzt7mU+wAAAQNJREFUKM+FU9m2wiAMTApl6Upr1bbu+f+PvIAVUK+HeYCQORkSSCCiGGTXtp0cCviG4khYN01tN64+yIkTE6N2ph4FIz6l7ImVfSJZ9CXbx6PBaveutqvQvOw9Hr6yKQ64xU+simzkK/a8n5dROdUvua+IevgXPSkXzJz0kd5wdPKM2wUFWNAHnE9gAQONgS79EuiRBpCoAz2vROscaI0SuhocFh8kjZFeYfHOuoO2AQ8bSNeH1o+rNe5PX9MG+m6958vtdjlbwwR6EzfM3b0otcxOfN3EX6kheQhBlKYWC/NgViQtLPMsmUfNfEnmQ/PtAKcfzZRpxUwjZ8YgP0SZEfwDHggf9l4buUIAAAAASUVORK5CYII=');\n"
+
" background-size: 100% auto;\n"
+
"}\n"
+
".floor-coupon .title .more {\n"
+
" position: absolute;\n"
+
" font-size: 0.1rem;\n"
+
" top: 0.01rem;\n"
+
" right: 0.1rem;\n"
+
" color: #888;\n"
+
"}\n"
+
".floor-coupon .title .more i {\n"
+
" display: inline-block;\n"
+
" margin-left: 0.02rem;\n"
+
" width: 0.045rem;\n"
+
" height: 0.075rem;\n"
+
" background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAOCAYAAAD9lDaoAAAAAXNSR0IArs4c6QAAAMJJREFUKBWFj0EKwjAQRZOQ7rMUQUGxnqMLN124zAWy6ZlSaG8hbnsPQUF3XqHB+KeQkrYYB4YZ8l9m/vC6ri+MsYOUsjTG3NEvQnjvV8hj3/dd27b7BYEHgQln1Bty8wvk9LNpmrVzrkObI19ZlhXx6gGCkARHKAVOoDnIOX8opXJBQhzwJiFKesPVTmvtJ5C1dgugg7ijKeBOqJ9x3RwAWFRV9aSJA5QCBugfQBB5ugYP8QoSQ9Alb4h0SRk8BDHUL2r8gjSPuiqVAAAAAElFTkSuQmCC') no-repeat;\n"
+
" background-size: 100% auto!important;\n"
+
"}\n"
+
".floor-coupon .fl {\n"
+
" float: left;\n"
+
"}\n"
+
".floor-coupon .fr {\n"
+
" float: right;\n"
+
"}\n"
+
".floor-coupon .item-con {\n"
+
" height: 0.6rem;\n"
+
" overflow: hidden;\n"
+
" *zoom: 1;\n"
+
"}\n"
+
".floor-coupon .item-con .item {\n"
+
" float: left;\n"
+
" position: relative;\n"
+
" display: block;\n"
+
" width: 1.85rem;\n"
+
" height: 0.6rem;\n"
+
" border-radius: 0.04rem;\n"
+
" background: #06cfb0;\n"
+
" overflow: hidden;\n"
+
" margin-left: 0.1rem;\n"
+
"}\n"
+
".floor-coupon .item-con .item::before {\n"
+
" position: absolute;\n"
+
" top: 0;\n"
+
" left: -0.035rem;\n"
+
" display: block;\n"
+
" width: 0.065rem;\n"
+
" height: 100%;\n"
+
" content: '';\n"
+
" background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAATBAMAAAC5GZqkAAAAGFBMVEUAAAD///////////////////////////8jfp1fAAAAB3RSTlMA19COPPlcVP4jQQAAADlJREFUCNdjIAhYjIJMQHRieXlhApArXl5eLsLAwFwOBMUMDEwguoiBgRVEl8L4MHmYeph+mHkEAQAVvxR725Dx8AAAAABJRU5ErkJggg==\") repeat-y;\n"
+
" background-size: 0.065rem 0.095rem;\n"
+
"}\n"
+
".floor-coupon .item-con .item::after {\n"
+
" position: absolute;\n"
+
" top: 0;\n"
+
" right: -0.04rem;\n"
+
" display: block;\n"
+
" width: 0.065rem;\n"
+
" height: 100%;\n"
+
" content: '';\n"
+
" background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAATBAMAAAC5GZqkAAAAGFBMVEUAAAD///////////////////////////8jfp1fAAAAB3RSTlMA19COPPlcVP4jQQAAADlJREFUCNdjIAhYjIJMQHRieXlhApArXl5eLsLAwFwOBMUMDEwguoiBgRVEl8L4MHmYeph+mHkEAQAVvxR725Dx8AAAAABJRU5ErkJggg==\") repeat-y;\n"
+
" background-size: 0.065rem 0.095rem;\n"
+
"}\n"
+
".floor-coupon .item-con .item .fl-a {\n"
+
" display: inline-block;\n"
+
" height: 0.6rem;\n"
+
" width: 100%;\n"
+
"}\n"
+
".floor-coupon .item-con .item .img-warp {\n"
+
" position: relative;\n"
+
" display: inline-block;\n"
+
" width: 0.5rem;\n"
+
" height: 0.5rem;\n"
+
" margin: 0.05rem 0 0 0.075rem;\n"
+
" border-radius: 0.02rem;\n"
+
" background-color: #fff;\n"
+
"}\n"
+
".floor-coupon .item-con .item .img-warp img {\n"
+
" position: absolute;\n"
+
" top: 50%;\n"
+
" -webkit-transform: translateY(-50%);\n"
+
" transform: translateY(-50%);\n"
+
" width: 0.5rem;\n"
+
" height: auto;\n"
+
"}\n"
+
".floor-coupon .item-con .item .info-warp {\n"
+
" position: absolute;\n"
+
" display: inline-block;\n"
+
" //height: 0.25rem;\n"
+
" width: 1rem;\n"
+
" color: #FFF;\n"
+
" text-align: left;\n"
+
" overflow: hidden;\n"
+
" white-space: nowrap;\n"
+
" text-overflow: ellipsis;\n"
+
" left: 0.65rem;\n"
+
" top: 50%;\n"
+
" -webkit-transform: translateY(-50%);\n"
+
" transform: translateY(-50%);\n"
+
"}\n"
+
".floor-coupon .item-con .item .info-warp .des {\n"
+
" overflow: hidden;\n"
+
" white-space: nowrap;\n"
+
" text-overflow: ellipsis;\n"
+
" display: inline-block;\n"
+
" font-size: 0.12rem;\n"
+
"}\n"
+
".floor-coupon .item-con .item .info-warp .subtitle {\n"
+
" overflow: hidden;\n"
+
" white-space: nowrap;\n"
+
" text-overflow: ellipsis;\n"
+
" font-size: 0.1rem;\n"
+
" padding-top: 0.03rem;\n"
+
"}\n"
+
".floor-coupon .item-con:before,\n"
+
".floor-coupon .item-con:after {\n"
+
" display: table;\n"
+
" content: \"\";\n"
+
"}\n"
+
".floor-coupon .item-con:after {\n"
+
" clear: both;\n"
+
"}\n"
+
".floor-coupon .view-more {\n"
+
" float: left;\n"
+
" font-size: 0.1rem;\n"
+
" height: 0.59rem;\n"
+
" padding: 0 0.2rem 0 0.1rem;\n"
+
" background-color: rgba(216, 216, 216, 0.1);\n"
+
" border: 1px solid rgba(151, 151, 151, 0.1);\n"
+
" color: #444;\n"
+
" margin-left: 0.1rem;\n"
+
" cursor: pointer;\n"
+
" display: table;\n"
+
" position: relative;\n"
+
"}\n"
+
".floor-coupon .view-more::before {\n"
+
" content: '';\n"
+
" position: absolute;\n"
+
" width: 0;\n"
+
" height: 0;\n"
+
" border: 0.045rem solid transparent;\n"
+
" border-left-color: #444;\n"
+
" right: 10px;\n"
+
" top: 50%;\n"
+
" margin-top: -0.045rem;\n"
+
"}\n"
+
".floor-coupon .view-more span {\n"
+
" display: table-cell;\n"
+
" vertical-align: middle;\n"
+
" line-height: 1.5;\n"
+
" width: 0.225rem;\n"
+
"}\n"
+
".floor-coupon .pd-space {\n"
+
" height: 0.6rem;\n"
+
" float: left;\n"
+
" width: 0.1rem;\n"
+
"}\n"
+
".scroll {\n"
+
" width: 100%;\n"
+
" height: 1rem;\n"
+
" overflow: auto;\n"
+
" box-sizing: border-box;\n"
+
" -webkit-overflow-scrolling: touch;\n"
+
"}\n"
+
".scroll .scroll-x {\n"
+
" width: 300rem;\n"
+
"}"
;
String
js
=
"if ( data && data.list && data.list.length) {\n"
+
" \tyangzuo.extend(data,global);\n"
+
" $(\"#renderRoot\").append(juicer(html, data));\n"
+
" var len = (data.list.length*390 + 20 + 158)/200;\n"
+
" $(\"#floor-coupon-scroll\").css(\"width\",len+\"rem\");\n"
+
"}"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤conpon"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
// 验证码
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
"6"
);
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
public
void
B_
优惠券手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
int
showNum
=
5
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"appId"
,
"18740"
);
json
.
put
(
"floorId"
,
floorId
);
json
.
put
(
"floorTitle"
,
"优惠券"
);
json
.
put
(
"showNum"
,
String
.
valueOf
(
showNum
));
json
.
put
(
"target"
,
"childPage"
);
response
=
devFloorChildPageService
.
couponPageConfig
(
authorization
.
hdLoginmabo
(),
json
.
toJSONString
());
Thread
.
sleep
(
70000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
Assert
.
assertEquals
(
list
.
size
(),
showNum
,
"配置数量和展示数量不相符"
);
}
@Test
public
void
C_
删除优惠券楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
response
.
prettyPrint
();
}
}
src/test/java/http/cases/FloorTest/Floor_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
http.service.Activity.NewtoolsService
;
import
http.service.Authorization
;
import
http.service.app.AerosolService
;
import
http.service.app.HomeService
;
import
http.service.hd.ActivityService
;
import
http.service.hd.DevFloorService
;
import
http.service.hd.PlatformCouponService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.testng.AbstractTestNGSpringContextTests
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.util.List
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
/**
* Created by hanzhanli on 2017/7/18.
*/
public
class
Floor_FloorTest
extends
DuibaTestBase
{
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@Value
(
"${uid}"
)
int
uid
;
@Value
(
"${appId}"
)
int
appId
;
@Autowired
Authorization
authorization
;
@Autowired
HomeService
homeService
;
@Autowired
DevFloorService
devFloorService
;
@Autowired
ActivityService
activityService
;
@Autowired
PlatformCouponService
platformCouponService
;
@Autowired
NewtoolsService
newtoolsService
;
@Autowired
AerosolService
aerosolService
;
// @Test
public
void
indexTest
()
throws
Exception
{
/* Map<String,String> cookies=authorization.dafuwengLogin();
logger.info(cookies);
Response response=given().cookies(cookies).get("http://home.m.duibatest.com.cn/chome/index?from=login&spm=2278.1.1.1");
logger.info(response.asString());*/
//authorization.hdLogin();
//JsonPath json=homeService.getCFG(2727);
//List<Map> list=json.getList("",Map.class);
//logger.info(list);
homeService
.
floor
(
"2"
,
"0"
,
"3"
,
"3"
);
//logger.info(Base64.encodeBase64(DigestUtils.sha1Hex("123456duiba").getBytes()));
//logger.info(SecurityUtils.getMD5("OhvdP1tOTMmqJv7Go4xi/CuZkCo=971eec6e-19db-4c7b-beb9-5db32f41a42b"));
}
@Test
(
description
=
"楼层icon"
)
public
void
iconTest
()
throws
Exception
{
Response
response
=
devFloorService
.
iconSelectedList
(
Integer
.
toString
(
appId
));
//response.print();
// logger.info("hd:"+response.asString());
List
<
Map
>
configList
=
from
(
response
.
asString
()).
getList
(
"data"
,
Map
.
class
);
//path:/floor/2/0,duibaPageId=3,floorId=3
response
=
homeService
.
floor
(
"2"
,
"0"
,
"3"
,
"3"
);
//response.prettyPrint();
String
s
=
new
String
(
response
.
asByteArray
(),
"UTF-8"
);
// logger.info("floor:"+s);
//logger.info(s.substring(s.indexOf("{"),s.length()-1));
List
<
Map
>
iconList
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
)).
getList
(
"list"
,
Map
.
class
);
//logger.info(s.substring(s.indexOf("{"),s.length()-1));
for
(
int
i
=
0
;
i
<
iconList
.
size
();
i
++){
Map
configMap
=
configList
.
get
(
i
);
Map
iconMap
=
iconList
.
get
(
i
);
String
dcm
=(
String
)
iconMap
.
get
(
"dcm"
);
String
[]
dcms
=
dcm
.
split
(
"."
);
Assert
.
assertEquals
(
dcm
.
split
(
"\\."
)[
1
],
configMap
.
get
(
"bannerId"
).
toString
(),
"dcm与配置bannerId不一致,dcm:"
+
dcm
+
",配置bannerId:"
+
configMap
.
get
(
"bannerId"
));
String
dpm
=(
String
)
iconMap
.
get
(
"dpm"
);
Assert
.
assertEquals
(
dpm
.
split
(
"\\."
)[
0
],
String
.
valueOf
(
appId
),
"dpm与预期不一致,dpm:"
+
dpm
+
",appId:"
+
appId
);
Assert
.
assertEquals
(
iconMap
.
get
(
"id"
),
configMap
.
get
(
"bannerId"
),
"id与配置的bannerId不一致,ID:"
+
iconMap
.
get
(
"id"
)+
",bannerId:"
+
configMap
.
get
(
"bannerId"
));
Assert
.
assertEquals
(
iconMap
.
get
(
"logo"
),
configMap
.
get
(
"img"
),
"logo与配置img不一致,logo:"
+
iconMap
.
get
(
"logo"
)+
",配置img:"
+
configMap
.
get
(
"img"
));
Assert
.
assertEquals
(
iconMap
.
get
(
"name"
),
configMap
.
get
(
"title"
),
"name与配置title不一致,name:"
+
iconMap
.
get
(
"name"
)+
",配置title:"
+
configMap
.
get
(
"title"
));
String
link
=(
String
)
iconMap
.
get
(
"link"
);
Assert
.
assertTrue
(
link
.
contains
(
dcm
),
"link中未包含正确的dcm,link:"
+
link
+
",dcm:"
+
dcm
);
Assert
.
assertTrue
(
link
.
contains
(
dpm
),
"link中未包含正确的dpm,link:"
+
link
+
",dcm:"
+
dpm
);
logger
.
info
(
"校验正确:"
+
iconMap
.
get
(
"name"
));
}
}
@Test
(
description
=
"楼层banner"
)
public
void
bannerTest
()
throws
Exception
{
Response
response
=
devFloorService
.
bannerSelectedList
(
Integer
.
toString
(
appId
));
// logger.info("hd:"+response.asString());
JsonPath
jsonPath
=
from
(
response
.
asString
());
List
<
Map
>
activityList
=
jsonPath
.
getList
(
"data"
,
Map
.
class
);
response
=
homeService
.
floor
(
"1"
,
"0"
,
"3"
,
"2"
);
String
s
=
response
.
asString
();
s
=
new
String
(
response
.
asByteArray
(),
"UTF-8"
);
// logger.info("floor:"+s);
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
bannerList
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
for
(
int
i
=
0
;
i
<
bannerList
.
size
();
i
++){
Map
banner
=
bannerList
.
get
(
i
);
Map
activity
=
activityList
.
get
(
i
);
Assert
.
assertEquals
(
activity
.
get
(
"title"
),
banner
.
get
(
"title"
));
Assert
.
assertEquals
(
activity
.
get
(
"img"
),
banner
.
get
(
"image"
));
logger
.
info
(
"校验正确:"
+
activity
.
get
(
"title"
));
}
}
@Test
(
description
=
"楼层商品区"
)
public
void
itemTest
()
throws
Exception
{
Response
response
=
devFloorService
.
itemSelectedList
(
Integer
.
toString
(
appId
));
// response.prettyPrint();
List
<
Map
>
configList
=
from
(
response
.
asString
()).
getList
(
"data"
,
Map
.
class
);
response
=
homeService
.
floor
(
"3"
,
"0"
,
"3"
,
"64"
);
String
s
=
new
String
(
response
.
asByteArray
(),
"UTF-8"
);;
//logger.info(s.substring(s.indexOf("{"),s.length()-1));
List
<
Map
>
itemList
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
)).
getList
(
"list"
,
Map
.
class
);
//开发者配置展示20个,校验手机端个数
//Assert.assertEquals(itemList.size(),20);
//校验前四个具体内容
for
(
int
i
=
0
;
i
<
2
;
i
++){
Map
configMap
=
configList
.
get
(
i
);
Map
itemMap
=
itemList
.
get
(
i
);
Assert
.
assertEquals
(
itemMap
.
get
(
"appItemId"
),
configMap
.
get
(
"appItemId"
),
"appItemId与配置的appItemId不一致,image:"
+
itemMap
.
get
(
"appItemId"
)+
",image:"
+
configMap
.
get
(
"appItemId"
));
Assert
.
assertEquals
(
itemMap
.
get
(
"title"
),
configMap
.
get
(
"title"
),
"title与配置title不一致,title:"
+
itemMap
.
get
(
"title"
)+
",配置title:"
+
configMap
.
get
(
"title"
));
Assert
.
assertEquals
(
itemMap
.
get
(
"image"
),
configMap
.
get
(
"img"
),
"image与配置img不一致,image:"
+
itemMap
.
get
(
"image"
)+
",配置img:"
+
configMap
.
get
(
"img"
));
logger
.
info
(
"校验正确:"
+
itemMap
.
get
(
"title"
));
}
}
@Test
(
description
=
"楼层默认橱窗"
)
public
void
showcaseTest
()
throws
Exception
{
Response
response
=
devFloorService
.
getShowcaseContent
(
Integer
.
toString
(
appId
));
logger
.
info
(
response
.
asString
());
List
<
Map
>
configList
=
from
(
response
.
asString
()).
getList
(
"data"
,
Map
.
class
);
int
i
=
3
;
while
(
configList
.
size
()==
0
&&
i
>
0
){
response
=
devFloorService
.
getShowcaseContent
(
Integer
.
toString
(
appId
));
configList
=
from
(
response
.
asString
()).
getList
(
"data"
,
Map
.
class
);
Thread
.
sleep
(
1000
);
i
--;
}
if
(
configList
.
size
()==
0
){
throw
new
Exception
(
"devFloorItem/selectedList接口异常,返回内容"
+
response
.
asString
());
}
response
=
homeService
.
floor
(
"8"
,
"0"
,
"3"
,
"186"
);
response
.
prettyPrint
();
String
s
=
new
String
(
response
.
asByteArray
(),
"UTF-8"
);;
//logger.info(s.substring(s.indexOf("{"),s.length()-1));
List
<
Map
>
showcaseList
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
)).
getList
(
"list"
,
Map
.
class
);
for
(
i
=
0
;
i
<
showcaseList
.
size
();
i
++){
Map
configMap
=
configList
.
get
(
i
);
Map
showcaseMap
=
showcaseList
.
get
(
i
);
String
dcm
=(
String
)
showcaseMap
.
get
(
"dcm"
);
// String[] dcms=dcm.split(".");
// Assert.assertEquals(dcm.split("\\.")[1],configMap.get("relationId").toString(),"dcm与配置bannerId不一致,dcm:"+dcm+",配置relationId:"+configMap.get("relationId"));
String
dpm
=(
String
)
showcaseMap
.
get
(
"dpm"
);
Assert
.
assertEquals
(
dpm
.
split
(
"\\."
)[
0
],
String
.
valueOf
(
appId
),
"dpm与预期不一致,dpm:"
+
dpm
+
",appId:"
+
appId
);
Assert
.
assertEquals
(
showcaseMap
.
get
(
"image"
),
configMap
.
get
(
"image"
),
"image与配置的image不一致,image:"
+
showcaseMap
.
get
(
"image"
)+
",image:"
+
configMap
.
get
(
"image"
));
Assert
.
assertEquals
(
showcaseMap
.
get
(
"relationTitle"
),
configMap
.
get
(
"relationTitle"
),
"relationTitle与配置relationTitle不一致,relationTitle:"
+
showcaseMap
.
get
(
"relationTitle"
)+
",配置img:"
+
configMap
.
get
(
"relationTitle"
));
Assert
.
assertEquals
(
showcaseMap
.
get
(
"relationImage"
),
configMap
.
get
(
"relationImage"
),
"relationImage与配置relationImage不一致,name:"
+
showcaseMap
.
get
(
"relationImage"
)+
",配置relationImage:"
+
configMap
.
get
(
"relationImage"
));
String
link
=(
String
)
showcaseMap
.
get
(
"btnLink"
);
// Assert.assertTrue(link.contains(dcm),"btnLink中未包含正确的dcm,btnLink:"+link+",dcm:"+dcm);
Assert
.
assertTrue
(
link
.
contains
(
dpm
),
"btnLink中未包含正确的dpm,btnLink:"
+
link
+
",dcm:"
+
dpm
);
logger
.
info
(
"校验正确:"
+
showcaseMap
.
get
(
"relationTitle"
));
}
}
@Test
(
description
=
"楼层优惠券"
)
public
void
PlatFormCouponTest
()
throws
Exception
{
Response
response
=
homeService
.
floor
(
"6"
,
"0"
,
"3"
,
"199"
);
String
s
=
response
.
asString
();
List
<
Map
>
list
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
)).
getList
(
"list"
,
Map
.
class
);
String
floorTitle
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
)).
getString
(
"floorTitle"
);
Assert
.
assertEquals
(
floorTitle
,
"优惠券"
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
Map
<
String
,
Object
>
map
=
list
.
get
(
i
);
String
dcm
=
map
.
get
(
"dcm"
).
toString
();
String
dpm
=
map
.
get
(
"dpm"
).
toString
();
String
pcgId
=
map
.
get
(
"pcgId"
).
toString
();
String
title
=
map
.
get
(
"title"
).
toString
();
String
html
=
platformCouponService
.
platformDetail
(
dcm
,
dpm
,
pcgId
).
asString
();
boolean
bl
=
html
.
contains
(
title
);
Assert
.
assertTrue
(
bl
);
logger
.
info
(
"校验正确:"
+
title
);
}
}
// @Test(description = "楼层秒杀")
// public void seckillTest() throws Exception {
// Response response=homeService.floor("10","0","3","100");
// response.prettyPrint();
// String s=response.asString();
// //List<Map> list= from(s.substring(s.indexOf("{"),s.length()-1)).getList("list", Map.class);
// s = MatcherString.getString(s,"\"url\":\"(.*?)\"}",1);
//// System.out.println(s);
// logger.info("请求秒杀url:"+s);
// response = given().cookies(authorization.dafuwengLogin(2720)).get("http:"+s);
// response.prettyPrint();
//
// s = MatcherString.getString(response.asString(),"<title>(.*?)</title>",1);
// Assert.assertEquals(s,"【勿动接口自动化】秒杀专题","校验title失败");
// logger.info("校验成功");
//
// }
// @Test(description = "楼层热门活动")
// public void actfloorTest() throws Exception {
// //获取楼层热门活动内容
// Response response=homeService.floor("5","0","3","148","28");
// response.prettyPrint();
// String s = new String(response.asByteArray(),"UTF-8");
//// logger.info(s);
// List<Map> list= from(s.substring(s.indexOf("{"),s.length()-1)).getList("list", Map.class);
//
// Map<String,Object> map = list.get(0);
// Assert.assertEquals(map.get("title"),"(13兑吧活动)自动化测试勿动","校验title失败");
// Assert.assertEquals(map.get("dcm"),"202.18543.0.0","校验dcm失败");
// Assert.assertEquals(String.valueOf(map.get("operatingId")),"18543","校验operatingId失败");
// Assert.assertEquals(map.get("dpm"),"2239.5.148.1","校验dpm失败");
// Assert.assertEquals(String.valueOf(map.get("credits")),"100","校验credits失败");
// Assert.assertEquals(String.valueOf(map.get("id")),"5277","校验id失败");
// Assert.assertEquals(map.get("banner"),"//yun.duiba.com.cn/h5/activity/turnCard/2.0/images/banner.jpg","校验banner失败");
// Assert.assertEquals(map.get("link"),"//activity.m.duibatest.com.cn/hdtool/index?id=18543&dbnewopen&dpm=2239.5.148.1&dcm=202.18543.0.0","校验banner失败");
// logger.info("校验成功");
//
//
//
//
//
//
// }
@Test
(
description
=
"浮标"
)
public
void
浮标
()
throws
Exception
{
Response
response
=
aerosolService
.
data
(
"3"
,
"jsonp10"
);
logger
.
info
(
response
.
asString
());
String
exceptUrl
=
"http://www.duiba.com.cn"
;
String
actUrl
=
MatcherString
.
getString
(
response
.
asString
(),
"\"link\":\"(.*?)\","
,
1
);
logger
.
info
(
"浮标配置url:"
+
actUrl
);
Assert
.
assertTrue
(
actUrl
.
contains
(
exceptUrl
),
"浮标url与配置的url不匹配"
);
logger
.
info
(
"校验浮标链接url正确"
);
}
// private Map<Object,Map> trasformate(String key,List<Map> toBeFiltered){
// Map<Object,Map> result=new HashedMap();
// for(int i=0;i<toBeFiltered.size();i++){
// Map map=toBeFiltered.get(i);
// result.put(map.get(key),map);
// }
// return result;
// }
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"1234"
);
}
}
src/test/java/http/cases/FloorTest/Game_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
/**
* Created by mabo on 2018/6/8
*/
public
class
Game_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
private
String
skinId
=
null
;
private
String
floorId
=
null
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@BeforeClass
public
void
beforeClass
(){
try
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤Game"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboGame"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
}
@Test
public
void
A_
创建游戏楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"9"
;
String
dataType
=
"0"
;
String
name
=
"maboGame"
;
String
skinWidth
=
"750"
;
String
html
=
"<div class=\"floor-game a-fadeinT\">\n"
+
" <div class=\"title\">\n"
+
" <div class=\"name\"><i></i>${floorTitle}</div>\n"
+
" <a href=\"${moreLink}\" class=\"more\">更多<i></i></a>\n"
+
" </div>\n"
+
" <div class=\"item-con\">\n"
+
" <div class=\"scroll\">\n"
+
" <div class=\"scroll-x\" id=\"floor-game-scroll\">\n"
+
" {@each list as item}\n"
+
" <a class=\"m-layout\" href=\"${item.link}\" db-log=\"${item.stInfo}\">\n"
+
" <img src=\"${item.bannerImg}\">\n"
+
" <div class=\"game-name\">${item.title}</div>\n"
+
" </a>\n"
+
" {@/each}\n"
+
" <div class=\"pd-space\"></div>\n"
+
" </div>\n"
+
" </div>\n"
+
" </div>\n"
+
"</div>"
;
String
css
=
".floor-game {\n"
+
" display: block;\n"
+
" padding: 0.1rem 0 0.1rem 0;\n"
+
" margin-bottom: 0.05rem;\n"
+
" border-top: 1px solid #dddddd;\n"
+
" border-bottom: 1px solid #dddddd;\n"
+
" background: #ffffff;\n"
+
"}\n"
+
".floor-game .title {\n"
+
" position: relative;\n"
+
" height: 0.15rem;\n"
+
" line-height: 0.15rem;\n"
+
" margin-left: 0.1rem;\n"
+
" margin-bottom: 0.11rem;\n"
+
" text-align: left;\n"
+
"}\n"
+
".floor-game .title .name {\n"
+
" display: inline-block;\n"
+
" font-size: 0.14rem;\n"
+
" color: #444;\n"
+
" line-height: 0.15rem;\n"
+
" margin-right: 0.15rem;\n"
+
"}\n"
+
".floor-game .title .name i {\n"
+
" display: inline-block;\n"
+
" vertical-align: top;\n"
+
" margin-right: 0.035rem;\n"
+
" width: 0.15rem;\n"
+
" height: 0.15rem;\n"
+
" background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAdVBMVEUAAABdQNZdQddfQthgT99dQdddQdZdQNddQddeQddeQNdeQNdfQddfQtlgQthkSNxsYv9eQddeQNZlTeReQddeQdZdQNdeQddeQddgQthdQddeQddeQNdeQNddQNdfQ9lfQddfQthfRdldQddeQNdgQ9ZdQNZr1CtdAAAAJnRSTlMA+9k6EPn0sKzt6saMUCcbBYV3CrmpzcBaSEdu49SjMF9EIb2TWLqDnUIAAAEvSURBVCjPhVNZdoMwDLQMttl3SAgB0rSd+x+xsbFL05Bn/SDPPKTRxnYL87rvur7OQ/ZqQSRAPE05QUTBP7JUSLKg0m4VZAlU+ZcdY9m0+7NtZHzZn2fixXO0gtPZ+Rc6vagJT2T/L2N+oDXk8ZZfyYIdWCGVqQgNO7QGur4oaY/pNokeOURm5SfDaqKlw8eGZCJkObYWrQTIB34TgNjEBMhZTZXxP6Ft4OajDFRRzXpu3DuANDdcfAXuBuQ961IrE/yrmmMAtxWYDJh2jlZAodUAuM6AsrQLzgGKKiKIfABgwd5JEwDmCYAcNS2tNFeYwJNJW5hriynoNH1Pi4TOb9vimpoBybiNqiZgsU11I2mXqPxdO2X8BoFvoP51YOObZfKsomeRPWfgPyLPCf4Azfkcffc9FNsAAAAASUVORK5CYII=');\n"
+
" background-size: 100% auto;\n"
+
"}\n"
+
".floor-game .title .more {\n"
+
" position: absolute;\n"
+
" font-size: 0.1rem;\n"
+
" top: 0.01rem;\n"
+
" right: 0.1rem;\n"
+
" color: #888;\n"
+
"}\n"
+
".floor-game .title .more i {\n"
+
" display: inline-block;\n"
+
" margin-left: 0.02rem;\n"
+
" width: 0.045rem;\n"
+
" height: 0.075rem;\n"
+
" background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAOCAYAAAD9lDaoAAAAAXNSR0IArs4c6QAAAMJJREFUKBWFj0EKwjAQRZOQ7rMUQUGxnqMLN124zAWy6ZlSaG8hbnsPQUF3XqHB+KeQkrYYB4YZ8l9m/vC6ri+MsYOUsjTG3NEvQnjvV8hj3/dd27b7BYEHgQln1Bty8wvk9LNpmrVzrkObI19ZlhXx6gGCkARHKAVOoDnIOX8opXJBQhzwJiFKesPVTmvtJ5C1dgugg7ijKeBOqJ9x3RwAWFRV9aSJA5QCBugfQBB5ugYP8QoSQ9Alb4h0SRk8BDHUL2r8gjSPuiqVAAAAAElFTkSuQmCC') no-repeat;\n"
+
" background-size: 100% auto!important;\n"
+
"}\n"
+
".floor-game .item-con {\n"
+
" height: 0.8rem;\n"
+
" overflow: hidden;\n"
+
" *zoom: 1;\n"
+
"}\n"
+
".floor-game .item-con .m-layout {\n"
+
" display: block;\n"
+
" float: left;\n"
+
" position: relative;\n"
+
" width: 1.425rem;\n"
+
" height: 0.625rem;\n"
+
" margin-right: 0.065rem;\n"
+
"}\n"
+
".floor-game .item-con .m-layout:first-child {\n"
+
" margin-left: 0.1rem;\n"
+
"}\n"
+
".floor-game .item-con .m-layout img {\n"
+
" width: 1.425rem;\n"
+
" height: 0.625rem;\n"
+
" border-radius: 0.1rem;\n"
+
" background-size: 100% auto!important;\n"
+
"}\n"
+
".floor-game .item-con .game-name {\n"
+
" margin-top: 0.05rem;\n"
+
" font-size: 0.12rem;\n"
+
" color: #666666;\n"
+
"}\n"
+
".floor-game .item-con:before,\n"
+
".floor-game .item-con:after {\n"
+
" display: table;\n"
+
" content: \"\";\n"
+
"}\n"
+
".floor-game .item-con:after {\n"
+
" clear: both;\n"
+
"}\n"
+
".floor-game .item-con .scroll {\n"
+
" height: 1rem !important;\n"
+
"}\n"
+
".floor-game .pd-space {\n"
+
" height: 0.6rem;\n"
+
" float: left;\n"
+
" width: 0.1rem;\n"
+
"}"
;
String
js
=
"if ( data && data.list && data.list.length) {\n"
+
" if (typeof ''.ossimg === 'function') {\n"
+
"\tdata.list = data.list.imgWebpArray('bannerImg');\n"
+
" }\n"
+
" yangzuo.extend(data,global);\n"
+
" if(data.list.length>5) {\n"
+
" data.list = data.list.slice(0,5);\n"
+
" }\n"
+
" $(\"#renderRoot\").append(juicer(html, data));\n"
+
" var len = (data.list.length*305 + 20)/200;\n"
+
" $(\"#floor-game-scroll\").css(\"width\",len+\"rem\");\n"
+
" //lazyload().getLazyImg();\n"
+
"}"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤game"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
// 验证码
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
type
);
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
public
void
B_
游戏手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
Thread
.
sleep
(
60000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
response
.
prettyPrint
();
System
.
out
.
println
(
s
);
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
String
floorTitle
=
jsonPath
.
getString
(
"floorTitle"
);
Assert
.
assertEquals
(
floorTitle
,
"趣味游戏"
,
"楼层title校验失败"
);
}
@Test
public
void
C_
删除游戏楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
response
.
prettyPrint
();
}
}
src/test/java/http/cases/FloorTest/Icon_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevFloorIconService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
/**
* Created by mabo on 2018/6/7
*/
public
class
Icon_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
@Autowired
DevFloorIconService
devFloorIconService
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
String
skinId
=
null
;
private
String
floorId
=
null
;
private
String
bannerId
=
null
;
@BeforeClass
public
void
beforeClass
(){
try
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤icon"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboicon"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devFloorIconService
.
selectedList
(
authorization
.
hdLoginmabo
(),
"18740"
);
List
<
Map
>
list
=
response
.
jsonPath
().
getList
(
"data"
,
Map
.
class
);
map
=
getByName
(
list
,
"今日必抢"
);
if
(
map
!=
null
){
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"appId"
,
"18740"
);
json
.
put
(
"bannerId"
,
map
.
get
(
"bannerId"
).
toString
());
response
=
devFloorIconService
.
delIcon
(
authorization
.
hdLoginmabo
(),
json
.
toJSONString
());
}
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
catch
(
Error
e
){
}
}
@Test
public
void
A_
创建
icon
楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"2"
;
String
dataType
=
"0"
;
String
name
=
"maboicon"
;
String
skinWidth
=
"750"
;
String
html
=
"<section class=\"floor-icon a-fadeinT\">\n"
+
" <div class=\"scroll\">\n"
+
" <div class=\"scroll-x\"> \n"
+
" <div id=\"J_iconList\">\n"
+
" \t {@each list as item,index}\n"
+
" <a href=\"${item.link}\" db-log=\"${item.stInfo}\" class=\"icon-a icon${list.length} {@if list.length > 4 }icon-large{@/if}\" >\n"
+
" <img src=\"${item.logo}\" alt=\"\"/> \n"
+
" <p>${item.name}</p>\n"
+
" </a>\n"
+
" {@/each}\n"
+
" </div>\n"
+
" </div> \n"
+
" </div>\n"
+
"</section>"
;
String
css
=
".floor-icon {\n"
+
" position: relative;\n"
+
" background: #FFF;\n"
+
" width: 100%;\n"
+
" margin-bottom: 0.21333333rem;\n"
+
" padding-top: 0.62666667rem;\n"
+
" height: 4.04266667rem;\n"
+
" overflow: hidden;\n"
+
"}\n"
+
".floor-icon .icon-a {\n"
+
" float: left;\n"
+
" text-align: center;\n"
+
"}\n"
+
".floor-icon .icon-a.icon3 {\n"
+
" width: 4.50133333rem;\n"
+
"}\n"
+
".floor-icon .icon-a.icon4 {\n"
+
" width: 3.41333333rem;\n"
+
"}\n"
+
".floor-icon .icon-a.icon5 {\n"
+
" width: 2.73066667rem;\n"
+
"}\n"
+
".floor-icon .icon-a.icon6,\n"
+
".floor-icon .icon-a.icon7 {\n"
+
" width: 2.47466667rem;\n"
+
"}\n"
+
".floor-icon .icon-a.icon-large {\n"
+
" width: 3.02933333rem;\n"
+
" margin-bottom: 0.42666667rem;\n"
+
"}\n"
+
".floor-icon .icon-a img {\n"
+
" width: 1.83466667rem;\n"
+
" height: 1.83466667rem;\n"
+
" margin-bottom: 0.41333333rem;\n"
+
" border-radius: 33%;\n"
+
"}\n"
+
".floor-icon .icon-a p {\n"
+
" font-family: PingFangSC-Regular;\n"
+
" font-size: 0.55466667rem;\n"
+
" color: #333;\n"
+
" letter-spacing: 0;\n"
+
" margin-bottom: 1rem;\n"
+
"}\n"
+
".scroll {\n"
+
" width: 100%;\n"
+
" height: 3.416rem;\n"
+
" overflow: auto;\n"
+
" box-sizing: border-box;\n"
+
" -webkit-overflow-scrolling: touch;\n"
+
"}\n"
+
".scroll .scroll-x {\n"
+
" width: 426.66666667rem;\n"
+
" height: 3.94266667rem;\n"
+
" padding: 0 0.53333333rem;\n"
+
" overflow: hidden;\n"
+
"}\n"
+
".scroll .scroll-x > div.large {\n"
+
" width: 90%;\n"
+
" margin: 0 auto;\n"
+
" display: -webkit-box;\n"
+
" display: -ms-flexbox;\n"
+
" display: flex;\n"
+
" -webkit-box-pack: justify;\n"
+
" -ms-flex-pack: justify;\n"
+
" justify-content: space-between;\n"
+
"}"
;
String
js
=
"if (data && data.list && data.list.length > 2) {\n"
+
" \t$(\"#renderRoot\").append(juicer(html, data));\n"
+
"\tif ( data.list.length > 4) {\n"
+
" var needWidth = (data.list.length) * 20;\n"
+
"\t var $iconLarge = $('.floor-icon').find('.icon-large');\n"
+
"\t $iconLarge.closest('.scroll-x').css('width', needWidth+'%');\n"
+
"\t $iconLarge.closest('.scroll').css('height', 'auto');\n"
+
"\t} else {\n"
+
"\t var $iconLarge = $('.floor-icon').find('.icon-a');\n"
+
"\t $iconLarge.closest('.scroll-x').css({width: '100%',height: '100%'});\n"
+
" $iconLarge.closest('.scroll-x>div').addClass('large');\n"
+
"\t}\n"
+
"}"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤icon"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
// 验证码
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
"2"
);
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
public
void
B_icon
添加图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
//应用皮肤
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"appId"
,
"18740"
);
json
.
put
(
"classifySwitch"
,
"false"
);
json
.
put
(
"iconType"
,
"list"
);
json
.
put
(
"img"
,
"//yun.dui88.com/duibaManagerWeb/dnb7ivbsjr.png"
);
json
.
put
(
"listType"
,
"iconDuiba"
);
json
.
put
(
"selected"
,
"false"
);
json
.
put
(
"show"
,
"true"
);
json
.
put
(
"sourceRelationId"
,
"2"
);
json
.
put
(
"target"
,
"今日必抢"
);
json
.
put
(
"title"
,
"今日必抢"
);
json
.
put
(
"appItemId"
,
"null"
);
json
.
put
(
"bannerId"
,
"null"
);
json
.
put
(
"classifyImage"
,
"null"
);
json
.
put
(
"payload"
,
"null"
);
response
=
devFloorIconService
.
saveIcon
(
authorization
.
hdLoginmabo
(),
json
.
toJSONString
());
response
.
prettyPrint
();
Thread
.
sleep
(
70000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
response
.
prettyPrint
();
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
Map
map
=
getByName
(
list
,
"今日必抢"
);
Assert
.
assertNotNull
(
map
,
"icon里没有今日必抢图标"
);
Assert
.
assertTrue
(
map
.
get
(
"link"
).
toString
().
contains
(
"//test-todayrob.m.dui88.com/todayrob/index?"
),
"今日必抢link校验错误"
);
Assert
.
assertEquals
(
map
.
get
(
"logo"
),
"//yun.dui88.com/duibaManagerWeb/dnb7ivbsjr.png"
,
"今日必抢logo校验错误"
);
map
=
getByName
(
list
,
"所有商品"
);
Assert
.
assertNotNull
(
map
,
"icon里没有所有商品图标"
);
Assert
.
assertTrue
(
map
.
get
(
"link"
).
toString
().
contains
(
"//activity.m.duibatest.com.cn/button/items?"
),
"所有商品link校验错误"
);
Assert
.
assertEquals
(
map
.
get
(
"logo"
),
"//yun.dui88.com/duibaManagerWeb/ispnglsd3n.png"
,
"所有商品logo校验错误"
);
map
=
getByName
(
list
,
"用户定制"
);
Assert
.
assertNotNull
(
map
,
"icon里没有用户定制图标"
);
Assert
.
assertTrue
(
map
.
get
(
"link"
).
toString
().
contains
(
"www.duiba.com.cn?"
),
"用户定制link校验错误"
);
Assert
.
assertEquals
(
map
.
get
(
"logo"
),
"//yun.dui88.com/duibaManagerWeb/912v0pc812.png"
,
"用户定制logo校验错误"
);
}
@Test
public
void
C_icon
编辑图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devFloorIconService
.
selectedList
(
authorization
.
hdLoginmabo
(),
"18740"
);
List
<
Map
>
list
=
response
.
jsonPath
().
getList
(
"data"
,
Map
.
class
);
Map
map
=
getByTitle
(
list
,
"今日必抢"
);
Assert
.
assertNotNull
(
map
,
"icon里没有今日必抢图标"
);
bannerId
=
map
.
get
(
"bannerId"
).
toString
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"appId"
,
"18740"
);
json
.
put
(
"bannerId"
,
bannerId
);
json
.
put
(
"classifyImage"
,
"null"
);
json
.
put
(
"classifySwitch"
,
"false"
);
json
.
put
(
"iconType"
,
"list"
);
json
.
put
(
"img"
,
"//yun.dui88.com/images/201806/9lz5ifre0h.png"
);
json
.
put
(
"listType"
,
"iconDuiba"
);
json
.
put
(
"sourceRelationId"
,
"2"
);
json
.
put
(
"title"
,
"今日必抢1"
);
response
=
devFloorIconService
.
updateIcon
(
authorization
.
hdLoginmabo
(),
json
.
toJSONString
());
response
.
prettyPrint
();
Thread
.
sleep
(
60000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
response
.
prettyPrint
();
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
map
=
getByName
(
list
,
"今日必抢1"
);
Assert
.
assertNotNull
(
map
,
"icon里没有今日必抢1图标"
);
// Assert.assertEquals(map.get("link"),"//test-todayrob.m.dui88.com/todayrob/index?dbnewopen=&dpm=18740.5.293.1&dcm=203.23044.0.0","今日必抢link校验错误");
Assert
.
assertEquals
(
map
.
get
(
"logo"
),
"//yun.dui88.com/images/201806/9lz5ifre0h.png"
,
"今日必抢logo校验错误"
);
}
@Test
public
void
D_icon
删除图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"appId"
,
"18740"
);
json
.
put
(
"bannerId"
,
bannerId
);
Response
response
=
devFloorIconService
.
delIcon
(
authorization
.
hdLoginmabo
(),
json
.
toJSONString
());
response
.
prettyPrint
();
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
floorType
,
dataType
,
"3"
,
floorId
);
response
.
prettyPrint
();
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
Map
map
=
getByName
(
list
,
"今日必抢"
);
Assert
.
assertNull
(
map
,
"icon里删除今日必抢图标失败"
);
}
@Test
public
void
E_
删除
icon
楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
response
.
prettyPrint
();
}
public
Map
getByName
(
List
<
Map
>
list
,
String
name
){
if
(
list
==
null
)
return
null
;
for
(
Map
map:
list
)
{
if
(
map
.
get
(
"name"
).
equals
(
name
))
return
map
;
}
return
null
;
}
public
Map
getByTitle
(
List
<
Map
>
list
,
String
name
){
for
(
Map
map:
list
)
{
if
(
map
.
get
(
"title"
).
equals
(
name
))
return
map
;
}
return
null
;
}
}
src/test/java/http/cases/FloorTest/Item_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevFloorService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
/**
* Created by mabo on 2018/6/7
* 商品区
*/
public
class
Item_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
@Autowired
DevFloorService
devFloorService
;
private
String
skinId
=
null
;
private
String
floorId
=
null
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@BeforeClass
public
void
beforeClass
(){
try
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤Item"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboItem"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
}
@Test
public
void
A_item
创建楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"3"
;
String
dataType
=
"0"
;
String
name
=
"maboItem"
;
String
skinWidth
=
"750"
;
String
html
=
"\n"
+
"<section class=\"floor-item a-fadeinT\">\n"
+
"\t<div class=\"floor-item-header\">\n"
+
"\t\t<div class=\"floor-item-title\"><span class=\"title-txt\">限量抢兑</span></div>\n"
+
"\t\t<div class=\"floor-item-title1\"><span class=\"title-txt1\"></span></div>\n"
+
" \n"
+
"\t</div>\n"
+
"\t<div id=\"J_itemList\" class=\"item-con\">\n"
+
"\t\t{@each list as item}\n"
+
"\t\t<a href=\"${item.link}\" db-log=\"${item.stInfo}\" class=\"item\">\n"
+
"\t\t\t<div class=\"img-wrap\">\n"
+
"\t\t\t\t{@if item.whiteImage}\n"
+
"\t\t\t\t<img src=\"${item.whiteImage}\"> {@else}\n"
+
"\t\t\t\t<img src=\"${item.image}\"> {@/if}\n"
+
"\t\t\t</div>\n"
+
"\t\t\t<div class=\"theme-color info-wrap\">\n"
+
"\t\t\t\t<h3 class=\"item-title\">${item.title}</h3>\n"
+
"\t\t\t\t<p>\n"
+
" \t{@if item.salePrice}\n"
+
"\t\t\t\t\t<span class=\"item-credits\">${item.credits} + ${item.salePrice}元</span>\n"
+
" \t{@else}\n"
+
" \t<span class=\"item-credits\">${item.credits}</span>\n"
+
" \t{@/if}\n"
+
"\t\t\t\t</p>\n"
+
" \t<p class=\"original-price\">\n"
+
" {@if !!item.tagText}\n"
+
" <span>原价</span>\n"
+
" <span class=\"corner\">${item.tagText}</span>\n"
+
" {@/if}\n"
+
" </p>\n"
+
"\t\t\t</div>\n"
+
"\t\t</a>\n"
+
"\t\t{@/each}\n"
+
"\t</div>\n"
+
"\t{@if moreUrl}\n"
+
"\t<a class=\"btn-more\" href=\"${moreUrl}\"><span class=\"more-txt\">全部商品</span><i></i></a>\n"
+
"\t{@/if}\n"
+
" <div class=\"tianchong\"></div>\n"
+
"\t<!--<p class=\"no-more\">已经没有更多啦!</p>-->\n"
+
"</section>"
;
String
css
=
"\n"
+
".floor-item {\n"
+
" background-color: #FFFFFF;\n"
+
"}\n"
+
".floor-item .tianchong {\n"
+
" width: 100%;\n"
+
" height: 0.512rem;\n"
+
" background: #F4F5F7;\n"
+
"}\n"
+
".floor-item .btn-more {\n"
+
" display: block;\n"
+
" text-align: center;\n"
+
" margin-top: 0.21333333rem;\n"
+
" height: 0.59733333rem;\n"
+
" line-height: 0.59733333rem;\n"
+
" padding-bottom: 1.28rem;\n"
+
"}\n"
+
".floor-item .btn-more .more-txt {\n"
+
" font-size: 0.512rem;\n"
+
" vertical-align: middle;\n"
+
" color: #333;\n"
+
" margin-bottom: 0.32rem;\n"
+
" height: 0.59733333rem;\n"
+
" line-height: 0.59733333rem;\n"
+
" text-align: center;\n"
+
" color: #767A81;\n"
+
" margin-top: 0.04266667rem;\n"
+
" font-family: PingFangSC-Regular;\n"
+
"}\n"
+
".floor-item .btn-more i {\n"
+
" display: inline-block;\n"
+
" margin-left: 0.17066667rem;\n"
+
" vertical-align: middle;\n"
+
" line-height: 0.59733333rem;\n"
+
" width: 0.512rem;\n"
+
" height: 0.512rem;\n"
+
" background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkBAMAAAATLoWrAAAAJFBMVEUAAAC6vL7///+5vL+70dG5vL66vMC6vL68vMC/v7++vsS5u76JD15jAAAAC3RSTlMAwQOkCqGBcj0oJ/6LF+EAAABCSURBVCjPY6A6YElXQBdi3G2ELrR692YFDFUYylikMZU5Dh5lWxkwlTXgFUJoxDQe0xF0VkQwOmZjizQjbAmAJgAAqKUu42A7d8UAAAAASUVORK5CYII=');\n"
+
" background-size: 100% 100%;\n"
+
"}\n"
+
".floor-item .floor-item-header {\n"
+
" position: relative;\n"
+
"}\n"
+
".floor-item .floor-item-header .floor-item-title1 {\n"
+
" margin-top: 0.42666667rem;\n"
+
" height: 0.64rem;\n"
+
" margin-bottom: 0.32rem;\n"
+
" text-align: center;\n"
+
" margin-bottom: 0.85333333rem;\n"
+
"}\n"
+
".floor-item .floor-item-header .floor-item-title1 .title-txt1 {\n"
+
" font-family: PingFangSC-Regular;\n"
+
" font-size: 0.512rem;\n"
+
" color: #B9BBBE;\n"
+
" line-height: 0.64rem;\n"
+
"}\n"
+
".floor-item .floor-item-header .floor-item-title {\n"
+
" height: 1.06666667rem;\n"
+
" margin-top: 0.42666667rem;\n"
+
" padding-top: 0.64rem;\n"
+
" padding-bottom: 0.64rem;\n"
+
" text-align: center;\n"
+
"}\n"
+
".floor-item .floor-item-header .floor-item-title i {\n"
+
" display: inline-block;\n"
+
" vertical-align: middle;\n"
+
" margin-right: 0.14933333rem;\n"
+
" width: 0.64rem;\n"
+
" height: 0.64rem;\n"
+
" background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAeFBMVEUAAADvK1HvMF/vLFDxK1LuLFHwLFHvK1HvLFHvK1HvK1DuLFDuLFHwLFHvLFDuLFDuLFHwLVPxLFLyLVH2LlL/M2b/M2bvLFHzLlTyL1HvK1HvK1DwLFHuLVLxK1DvK1DvK1DvLFLzM1XuLFHwLFLvLFHvK1HuK1DpUsVBAAAAJ3RSTlMA+RCuPLl37urajNiphfv0xlBHORwKBcAoJePPZlpXy55NFJeGbi9ZcP/rAAABI0lEQVQoz4WT2XKDMAxFvWKbnbAGSNKki/7/DwsCFdzMgF5s5qDra0lmW4giibWOk0Kw9yglBx7leTQtsvwHKwk2VM28bVRoQVZ7ejFZUG+fdZCZy/Z5S93VV+tcevvLTds3N6JN1/zKuI1u3JnlfJmRsq+fSbwRBPNy74HCjsgDKOdkO3t+cdgFytV2Shc8nPcK9nHH9JALVoBCbYAwQdQ+ARZ1BQVLONZqBNAd4u8AFjes4QmLo9UHgBo5wMern4QW81HMdI67rwmbp1DXboDpnwXnmvAnCjv9wFUSJvHYc96SOFnTHh7IGl3s4eGeLkZlcR42VBYqqgUvqKjUEu5jsbaEGjr4Z1NDaRx+9jxSNA5Hw3Q8iseDfPoMzh/RyRP8BeV2K8kLQfm+AAAAAElFTkSuQmCC');\n"
+
" background-size: 100% 100%;\n"
+
"}\n"
+
".floor-item .floor-item-header .floor-item-title .title-txt {\n"
+
" font-size: 0.68266667rem;\n"
+
" color: #333;\n"
+
" font-weight: 600;\n"
+
" line-height: 0.64rem;\n"
+
" font-family: PingFangSC-Medium;\n"
+
"}\n"
+
".floor-item .floor-item-header .floor-item-title .title-txt-y {\n"
+
" font-weight: normal;\n"
+
" font-size: 0.68266667rem;\n"
+
" color: #ff2f2f;\n"
+
"}\n"
+
".floor-item .item-con {\n"
+
" width: 100%;\n"
+
" height: 18rem;\n"
+
" overflow: hidden;\n"
+
" *zoom: 1;\n"
+
"}\n"
+
".floor-item .item-con > .item {\n"
+
" float: left;\n"
+
" width: 6.656rem;\n"
+
" position: relative;\n"
+
" background: #fff;\n"
+
" margin-left: 0.85333333rem;\n"
+
" margin-bottom: 0.42666667rem;\n"
+
" overflow: hidden;\n"
+
" height: 8.8rem;\n"
+
"}\n"
+
".floor-item .item-con > .item:nth-child(2n) {\n"
+
" margin-right: 0.85333333rem;\n"
+
"}\n"
+
".floor-item .item-con .img-wrap {\n"
+
" width: 6.656rem;\n"
+
" padding: 0;\n"
+
" position: relative;\n"
+
"}\n"
+
".floor-item .item-con .img-wrap img {\n"
+
" width: 100%;\n"
+
"}\n"
+
".floor-item .item-con .img-wrap .corner {\n"
+
" position: absolute;\n"
+
" bottom: 0.21333333rem;\n"
+
" left: 0.46933333rem;\n"
+
" font-size: 0.55466667rem;\n"
+
" color: #fff;\n"
+
" padding: 0 0.17066667rem;\n"
+
" height: 0.85333333rem;\n"
+
" line-height: 0.85333333rem;\n"
+
" text-align: center;\n"
+
" vertical-align: top;\n"
+
" -webkit-transform: scale(0.9);\n"
+
" transform: scale(0.9);\n"
+
" -webkit-transform-origin: 0 0;\n"
+
" transform-origin: 0 0;\n"
+
" display: inline-block;\n"
+
" background-color: #ff2f2f;\n"
+
"}\n"
+
".floor-item .item-con .info-wrap {\n"
+
" min-height: 3.84rem;\n"
+
"}\n"
+
".floor-item .item-con .info-wrap p {\n"
+
" line-height: 0.68266667rem;\n"
+
"}\n"
+
".floor-item .item-con .info-wrap p .item-credits {\n"
+
" font-size: 0.55466667rem;\n"
+
" position: relative;\n"
+
" display: inline-block;\n"
+
" vertical-align: top;\n"
+
" color: #191D21;\n"
+
" line-height: 0.85333333rem;\n"
+
" font-family: DIN-Medium;\n"
+
"}\n"
+
".floor-item .item-con .info-wrap p .mb12 {\n"
+
" display: inline-block;\n"
+
" background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFFmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDAgNzkuMTYwNDUxLCAyMDE3LzA1LzA2LTAxOjA4OjIxICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi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USUq1oBw1MUtAE37Nq0SC6n8XQLIfJULIoAFDcDs6Lvuj4H1X95M6sCX2M5UnFQPyXfFQA6f5AJVoTIfDve41Q8K7owitahg608EVOYU3FgRV1Mb1IqeJmWZq71ebP2gqntzwbIsa7WPm2tgsh6LYzrSXJwtt9ob885twRSZCIyntlRGj2c2zd0PXWh9rujh0kHzekgEJmph/UQxfpXmN3vgdvZDtbE3RUqMuFHmGpgcS8PcwK2+kvdILpBMnb2EOC+JyNqWQO6rhjXjRCEE8cF9Sxrnfs6NW3Tq0M7CXjT4VJXZkRDXbobpcU0CIgbTBfOGPNT+OKG/pWPQ5ed34a2/P7KmRh2DjPxGRY7K3OKPQ9rbOiguLzyHtSczp4Ssg6KYv8CclObX7+VqbgdoILJy6GECjoA9CMwmjtLCVayzhNEzMr/4RaFWEdCdtrvu3497QEX2LxvhkdCpk54YAAAAAElFTkSuQmCC');\n"
+
" width: 0.85333333rem;\n"
+
" height: 0.85333333rem;\n"
+
" background-size: 100% 100%;\n"
+
"}\n"
+
".floor-item .item-con .original-price {\n"
+
" font-size: 0.5rem;\n"
+
" line-height: 1rem;\n"
+
" color: #666;\n"
+
"}\n"
+
".floor-item .item-con .original-price .corner {\n"
+
" text-decoration:line-through;\n"
+
"}\n"
+
".floor-item .item-con .item-title {\n"
+
" padding-top: 0.21333333rem;\n"
+
" font-weight: 400;\n"
+
" font-size: 0.59733333rem;\n"
+
" line-height: 0.93866667rem;\n"
+
" margin-bottom: 0.29866667rem;\n"
+
" display: -webkit-box;\n"
+
" -webkit-box-orient: vertical;\n"
+
" -webkit-line-clamp: 2;\n"
+
" overflow: hidden;\n"
+
" font-family: PingFangSC-Medium;\n"
+
" color: #191D21;\n"
+
"}\n"
+
".floor-item .item-con:before,\n"
+
".floor-item .item-con:after {\n"
+
" display: table;\n"
+
" content: \"\";\n"
+
"}\n"
+
".floor-item .item-con:after {\n"
+
" clear: both;\n"
+
"}\n"
+
".floor-item .no-more {\n"
+
" margin-top: 0.55466667rem;\n"
+
" text-align: center;\n"
+
" font-size: 0.512rem;\n"
+
" color: #999;\n"
+
"}\n"
+
".apple {\n"
+
" width: 100% !important;\n"
+
" height: 100% !important;\n"
+
" margin-top: 0 !important;\n"
+
" margin-bottom: 0 !important;\n"
+
" border-radius: 0 !important;\n"
+
" padding-top: 0.21333333rem !important;\n"
+
" padding-bottom: 0.21333333rem !important;\n"
+
" background: #F4F5F7 !important;\n"
+
"}\n"
+
".apple p {\n"
+
" padding-top: 0;\n"
+
" font-size: 0.46933333rem;\n"
+
" color: #bbb;\n"
+
" text-align: center;\n"
+
"}\n"
+
"body {\n"
+
" background: #FFFFFF;\n"
+
"}"
;
String
js
=
"if(data && data.list && data.list.length) {\n"
+
"\tyangzuo.extend(data,global);\n"
+
" \tyangzuo.element(\"#renderRoot\").append(juicer(html, data));\n"
+
"}"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤item"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
// 验证码
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
"3"
);
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
public
void
B_item
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
Thread
.
sleep
(
70000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
response
=
devFloorService
.
itemSelectedList
(
"18740"
);
List
<
Map
>
listDev
=
response
.
jsonPath
().
getList
(
"data"
,
Map
.
class
);
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
Assert
.
assertEquals
(
list
.
size
(),
listDev
.
size
(),
"开发者配置和手机端展示数量不符"
);
}
@Test
public
void
C_item
删除楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
response
.
prettyPrint
();
}
}
src/test/java/http/cases/FloorTest/Seckill_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
import
static
utils
.
StringUtil
.
getMatcher
;
/**
* Created by mabo on 2018/6/8
*/
public
class
Seckill_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
private
String
skinId
=
null
;
private
String
floorId
=
null
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@BeforeClass
public
void
beforeClass
(){
try
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤Sckill"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboSckill"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
}
//免单秒杀
@Test
public
void
A_Seckill
创建楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"10"
;
String
dataType
=
"0"
;
String
name
=
"maboSckill"
;
String
skinWidth
=
"640"
;
String
html
=
"<section class=\"floor-seckill a-fadeinT\">\n"
+
" <div class=\"rob-seconds-kill\">\n"
+
" <div class=\"seconds-kill-header\">\n"
+
" <i class=\"seconds-kill-icon\"></i>\n"
+
" <ul class=\"seconds-kill-list\">\n"
+
" {@each list as item,index}\n"
+
" {@if item.startTime}\n"
+
" <li>\n"
+
" <a href=\"javascript:void(0)\" class=\"seconds-title\" data-index=\"${index}\">\n"
+
" <span class=\"countdown-title\">${item.title}</span>\n"
+
" </a>\n"
+
" </li>\n"
+
" {@/if}\n"
+
" {@/each}\n"
+
" </ul>\n"
+
" </div>\n"
+
" <div class=\"seconds-kill-content\">\n"
+
" {@each list as item,index}\n"
+
" <div class=\"seconds-kill-goods seconds-kill-goods-${index}\" style=\"display: none;\">\n"
+
" <div class=\"swiper-wrapper\">\n"
+
" {@if item.secondType === 'secondSubject'}\n"
+
" {@each item.seckillList as subject}\n"
+
" <div class=\"swiper-slide subject-slide\" db-log=\"${subject.stInfo}\">\n"
+
" <a href=\"${subject.url}\">\n"
+
" <img src=\"${subject.image}\" alt=\"\" class=\"subject-img\">\n"
+
" </a>\n"
+
" </div>\n"
+
" {@/each}\n"
+
" {@else if item.secondType === 'secondActivity'}\n"
+
" {@each item.seckillList as activity}\n"
+
" <div class=\"swiper-slide activity-slide\">\n"
+
" <a href=\"${activity.url}\">\n"
+
" <img src=\"${activity.image}\" alt=\"\" class=\"activity-img\">\n"
+
" </a>\n"
+
" <div class=\"activity-info\">\n"
+
" <h3 class=\"activity-title\">\n"
+
" <a href=\"${activity.url}\">${activity.title}</a>\n"
+
" </h3>\n"
+
" <p class=\"activity-credits\">${activity.credits + cCreditsUnitName}</p>\n"
+
" <p class=\"j-seconds-btn-wrapper\">\n"
+
" </p>\n"
+
" </div>\n"
+
" </div>\n"
+
" {@/each}\n"
+
" {@/if}\n"
+
" </div>\n"
+
" </div>\n"
+
" {@/each}\n"
+
" </div>\n"
+
" </div>\n"
+
"</section>"
;
String
css
=
".floor-seckill {\n"
+
" margin-bottom: 0.05rem;\n"
+
"}\n"
+
".floor-seckill .rob-seconds-kill {\n"
+
" overflow: hidden;\n"
+
" background-color: #f1f1f1;\n"
+
" border: solid #e6e6e6;\n"
+
" border-width: 1px 0;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-header {\n"
+
" background-color: #fff;\n"
+
" height: 0.33rem;\n"
+
" padding: 0.04rem 0 0.08rem 0;\n"
+
" overflow: hidden;\n"
+
" position: relative;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list {\n"
+
" position: relative;\n"
+
" left: 0.45rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list li {\n"
+
" float: left;\n"
+
" font-size: 0.12rem;\n"
+
" line-height: 0.215rem;\n"
+
" padding: 0 0.15rem;\n"
+
" position: relative;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list li::after {\n"
+
" content: '';\n"
+
" position: absolute;\n"
+
" right: 0;\n"
+
" top: 0.03rem;\n"
+
" height: 0.12rem;\n"
+
" width: 0;\n"
+
" border-left: 1px dotted #ccc;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list li:last-child {\n"
+
" padding-right: 0;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list li:last-child::after {\n"
+
" display: none;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list li:first-child .seconds-title {\n"
+
" padding-left: 0.2rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list .seconds-title {\n"
+
" color: #333;\n"
+
" display: block;\n"
+
" padding: 0 0.11rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list .seconds-title.active {\n"
+
" background-color: #efefef;\n"
+
" border-radius: 0.11rem;\n"
+
" padding: 0 0.1rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list .seconds-title.active .countdown-title {\n"
+
" color: #333;\n"
+
" font-weight: bold;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list .countdown {\n"
+
" display: inline-block;\n"
+
" font-size: 0.1rem;\n"
+
" color: #666;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list .countdown-item {\n"
+
" display: inline-block;\n"
+
" width: 0.15rem;\n"
+
" height: 0.15rem;\n"
+
" line-height: 0.15rem;\n"
+
" margin-top: 0.015rem;\n"
+
" margin-left: 0.02rem;\n"
+
" border: 1px solid #9e9e9e;\n"
+
" background-color: #fff;\n"
+
" text-align: center;\n"
+
" color: #333;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-list .split {\n"
+
" margin-left: 0.02rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-icon {\n"
+
" position: absolute;\n"
+
" left: 0;\n"
+
" width: 0.73rem;\n"
+
" height: 0.215rem;\n"
+
" background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJMAAAArCAMAAABLoko/AAABOFBMVEUAAAD/Ojr/Ozv/Ozv/OTn/OTn/OTn/PDz/Ojr/Pj7/OTn/Ozv/Ozv/Ozv/Ozv/Ozv/Ozv/OTn/OTn/OTn/Ojr/Ojr/Ojr/Ozv/Ojr/OTn/Ozv/OTn/OTn/OTn/P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mfz++sDFBBUkeBZVQqV3tkNVqykl5+rDac29uvPyMvw9MTAlioVM701A6T/5Nb164Pr3Rvulxznc9MOYfYMy9Ow5ich+5drZhmx86iImNuRsfzx3ERN6t7655cXE6iAnHfAsXp4OYyNuNjT32sOAgptdHniPtaQH0E2HhQCLOU8w2AAAAAElFTkSuQmCC) no-repeat;\n"
+
" background-size: 0.73rem 0.215rem;\n"
+
" z-index: 2;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-content {\n"
+
" background-color: #fff;\n"
+
" padding: 0 0.1rem 0.08rem 0.1rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-content .activity-info {\n"
+
" margin-left: 1.225rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-content .activity-img {\n"
+
" float: left;\n"
+
" height: auto;\n"
+
" width: 1.125rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-content .subject-img {\n"
+
" float: left;\n"
+
" width: auto;\n"
+
" height: 0.7rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-content .activity-title {\n"
+
" color: #444;\n"
+
" font-size: 0.14rem;\n"
+
" line-height: 1.2;\n"
+
" overflow: hidden;\n"
+
" text-overflow: ellipsis;\n"
+
" white-space: nowrap;\n"
+
" margin-top: 0.02rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-content .activity-credits {\n"
+
" color: #ff3e3e;\n"
+
" font-size: 0.12rem;\n"
+
" margin: 0.04rem 0 0.1rem 0;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-goods .swiper-slide {\n"
+
" height: 0.7rem;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-goods .swiper-slide.activity-slide {\n"
+
" overflow: hidden;\n"
+
" width: 2.3rem;\n"
+
" white-space: nowrap;\n"
+
"}\n"
+
".floor-seckill .seconds-kill-goods .swiper-slide.subject-slide {\n"
+
" width: auto;\n"
+
"}\n"
+
".floor-seckill .activity-btn {\n"
+
" line-height: 0.22rem;\n"
+
" border-radius: 0.125rem;\n"
+
" font-size: 0.12rem;\n"
+
" display: inline-block;\n"
+
" padding: 0 0.125rem;\n"
+
"}\n"
+
".floor-seckill .activity-btn.btn-red {\n"
+
" background-color: #ff3e3e;\n"
+
" border: 1px solid #ff3e3e;\n"
+
" color: #fff;\n"
+
"}\n"
+
".floor-seckill .activity-btn.btn-border-red {\n"
+
" border: 1px solid #ff3e3e;\n"
+
" background-color: #fff;\n"
+
" color: #ff3e3e;\n"
+
"}\n"
+
".floor-seckill .activity-btn.btn-gray {\n"
+
" border: 1px solid #ccc;\n"
+
" background-color: #ccc;\n"
+
" color: #fff;\n"
+
"}"
;
String
js
=
";(function(window){\n"
+
" 'use strict';\n"
+
"\n"
+
" var defaultConfig = {\n"
+
" // bengin-time && end-time\n"
+
" gmt_begin: null,\n"
+
" gmt_end: null,\n"
+
"\n"
+
" // default countdown container element\n"
+
" selector: '.countdown',\n"
+
" // messages\n"
+
" msgPattern :'剩{days}天{hours}时{minutes}分{seconds}秒',\n"
+
" msgBefore: '距开团仅剩{beginremain}分钟',\n"
+
" msgAfter: '特卖已经结束',\n"
+
" msgStartPatternBegin: '剩',\n"
+
" msgPrePatternBegin: '剩',\n"
+
" msgDayPattern : '{days}天',\n"
+
" msgHourPattern : '{hours}时',\n"
+
" msgMinPattern : '{minutes}分',\n"
+
" msgSecondPattern : '{seconds}秒',\n"
+
" msgStartPatternEnd: '',\n"
+
" msgPrePatternEnd: '',\n"
+
" leadingZeros: false,\n"
+
" currentTime: 0,\n"
+
" patternType:{//为1时使用原来的msgPattern或msgBefore,为2时使用pattern拼接\n"
+
" pre:1,\n"
+
" start:1\n"
+
" }, \n"
+
" hidePattern:[],//可传参数如'{days}',与patternType为2时配合使用,表示取值为0时,要省略的pattern\n"
+
" finishCallback: function() {},//倒计时已结束\n"
+
" startCallback :function() {},//进行时的倒计时运行前的回调\n"
+
" preCallback :function(){}//未开始的倒计时运行前的回调\n"
+
" };\n"
+
"\n"
+
" var Countdown = function(conf) {\n"
+
" var cf = $.extend({}, defaultConfig, conf),\n"
+
" started = false,\n"
+
" interval = 1000,\n"
+
" container = $(cf.selector),\n"
+
" patterns = [{\n"
+
" pattern: '{years}',\n"
+
" secs: 31536000\n"
+
" }, {\n"
+
" pattern: '{months}',\n"
+
" secs: 2628000\n"
+
" }, {\n"
+
" pattern: '{weeks}',\n"
+
" secs: 604800\n"
+
" }, {\n"
+
" pattern: '{days}',\n"
+
" secs: 86400\n"
+
" }, {\n"
+
" pattern: '{hours}',\n"
+
" secs: 3600\n"
+
" }, {\n"
+
" pattern: '{minutes}',\n"
+
" secs: 60\n"
+
" }, {\n"
+
" pattern: '{seconds}',\n"
+
" secs: 1\n"
+
" }, {\n"
+
" pattern: '{secfixedtoten}',\n"
+
" secs: 1\n"
+
" }, {\n"
+
" pattern: '{secfixedtohun}',\n"
+
" secs: 1\n"
+
" }, {\n"
+
" pattern: '{secfixedtothus}',\n"
+
" secs: 1\n"
+
" }\n"
+
"\n"
+
" ],\n"
+
" patternMap={\n"
+
" '{years}':cf.msgYearPattern||'',\n"
+
" '{months}':cf.msgMonPattern||'',\n"
+
" '{weeks}':cf.msgWeekPattern||'',\n"
+
" '{days}':cf.msgDayPattern||'',\n"
+
" '{hours}':cf.msgHourPattern||'',\n"
+
" '{minutes}':cf.msgMinPattern||'',\n"
+
" '{seconds}':cf.msgSecondPattern||'',\n"
+
" '{secfixedtoten}':cf.msgSecondFixtotenPattern||'',\n"
+
" '{secfixedtohun}':cf.msgSecondFixtohunPattern||'',\n"
+
" '{secfixedtothus}':cf.msgSecondFixtothusPattern||''\n"
+
" },\n"
+
" output,\n"
+
" timer,\n"
+
"\n"
+
"\n"
+
" defineInterval = function() {\n"
+
" for (var e = patterns.length; e > 0; e--) {\n"
+
" var currentPattern = patterns[e - 1];\n"
+
"\n"
+
" if (cf.msgPattern.indexOf(currentPattern.pattern) !== -1) {\n"
+
" interval = currentPattern.secs * 1000;\n"
+
" return;\n"
+
" }\n"
+
" }\n"
+
" },\n"
+
"\n"
+
" outOfInterval = function(beginremain,type) {\n"
+
" var tpl = beginremain > 0 ? cf.msgBefore : cf.msgAfter;\n"
+
" var minTimer;\n"
+
" if (beginremain > 0) {\n"
+
" if(type==1){\n"
+
" minTimer = setInterval(function() {\n"
+
"\n"
+
" beginremain -= 1;\n"
+
" var number = Math.floor(beginremain / 60);\n"
+
" var displayed = cf.leadingZeros && number <= 9 ? \"0\" + number : number;\n"
+
" if (beginremain < 0) {\n"
+
" window.clearInterval(minTimer);\n"
+
" } \n"
+
" output = tpl.replace('{beginremain}', displayed);\n"
+
"\n"
+
" if (container.html() != output) {\n"
+
" container.html(output);\n"
+
" }\n"
+
"\n"
+
" }, 1000); \n"
+
" }\n"
+
"\n"
+
"\n"
+
" } else {\n"
+
" cf.finishCallback(container,output);\n"
+
" }\n"
+
" },\n"
+
"\n"
+
" display = function(sec,patternType,isStart,pattern) { \n"
+
"\n"
+
" var output= (pattern||cf.msgPattern);//默认模板\n"
+
"\n"
+
" if(isStart){//如果已经开始\n"
+
" patternType=patternType.start;\n"
+
" }else{//未开始\n"
+
" patternType=patternType.pre;\n"
+
" }\n"
+
" if(patternType==2){//如果要省略0,使用拼接式的模板\n"
+
" output=isStart?cf.msgStartPatternBegin:cf.msgPrePatternBegin;\n"
+
" }\n"
+
" \n"
+
" for (var i = 0, len = patterns.length; i < len; i++) {\n"
+
" var currentPattern = patterns[i];\n"
+
" //获取当前模板,如果patternType不为2,用默认模板\n"
+
" var currentTpl=patternType==2?(patternMap[currentPattern.pattern]||''):output;\n"
+
" var currentPatternSecs = currentPattern.secs * 10;\n"
+
" if (currentTpl.indexOf(currentPattern.pattern) !== -1) {\n"
+
" if (currentPattern.pattern === '{secfixedtoten}') {\n"
+
" var number = new Number(sec / currentPatternSecs).toFixed(1);\n"
+
"\n"
+
" } else if (currentPattern.pattern === '{secfixedtohun}') {\n"
+
" var number = new Number(sec / currentPatternSecs).toFixed(2);\n"
+
"\n"
+
" } else if (currentPattern.pattern === '{secfixedtothus}') {\n"
+
" var number = new Number(sec / currentPatternSecs).toFixed(3);\n"
+
"\n"
+
" } else {\n"
+
" var number = Math.floor(sec / currentPatternSecs);\n"
+
"\n"
+
" }\n"
+
" var displayed = cf.leadingZeros && number <= 9 ? \"0\" + number : number;\n"
+
" sec -= number * currentPatternSecs;\n"
+
" // 省略值为0的pattern\n"
+
" if(patternType==2){\n"
+
" if(cf.hidePattern && Number(displayed)==0 && cf.hidePattern.indexOf(currentPattern.pattern)!==-1){\n"
+
" output+='';\n"
+
" }else{\n"
+
" output+=currentTpl.replace(currentPattern.pattern, displayed);\n"
+
" } \n"
+
" }else{\n"
+
" output = output.replace(currentPattern.pattern, displayed);\n"
+
" }\n"
+
"\n"
+
" }\n"
+
" }\n"
+
" if(patternType==2){\n"
+
" output+= isStart?cf.msgStartPatternEnd:cf.msgPrePatternEnd;\n"
+
" }\n"
+
" container.html(output);\n"
+
" },\n"
+
"\n"
+
" run = function() {\n"
+
" //var sec = Math.abs(cf.gmt_end - (+new Date / 1000)),\n"
+
" var newDate = cf.currentTime * 1000 || new Date;\n"
+
" var sec = Math.abs(cf.gmt_end * 10 - (+newDate / 100));\n"
+
" var beginremain = cf.gmt_begin - (+newDate / 1000);\n"
+
" //msgBefore的类型,它可以是默认的分钟倒计时,也可以是天时分秒倒计时\n"
+
" var type=cf.msgBefore.indexOf('{beginremain}')!==-1?1:2;\n"
+
" if (isStarted(cf.gmt_begin)) {\n"
+
" started = true;\n"
+
" cf.startCallback(container);\n"
+
" display(sec,cf.patternType,started);\n"
+
" } else if (beginremain > 0) {\n"
+
" cf.preCallback(container);\n"
+
"\n"
+
" if(type==2 || cf.patternType.pre==2){\n"
+
" sec=beginremain*10;\n"
+
" display(sec,cf.patternType,started,cf.msgBefore);\n"
+
" }else{\n"
+
" outOfInterval(beginremain,type);\n"
+
" }\n"
+
" \n"
+
" } else {\n"
+
" outOfInterval();\n"
+
" }\n"
+
"\n"
+
" // Vanilla JS alternative to $.proxy\n"
+
" timer = window.setInterval(function() {\n"
+
" sec--;\n"
+
" \n"
+
" if (isStarted(cf.gmt_begin) && !isOver(cf.gmt_end)) {\n"
+
" if (!started) {\n"
+
" sec=Math.abs(cf.gmt_end * 10 - (+newDate / 100));\n"
+
" started = true;\n"
+
" cf.startCallback(container);\n"
+
" }\n"
+
" display(sec,cf.patternType,started);\n"
+
" \n"
+
" }else if(sec>0){\n"
+
" if(type==2 || cf.patternType.pre==2){\n"
+
" display(sec,cf.patternType,started,cf.msgBefore);\n"
+
" }\n"
+
" }else if(sec <= 0){// Time over\n"
+
" window.clearInterval(timer);\n"
+
" outOfInterval(); \n"
+
" }\n"
+
" }, interval / 10);\n"
+
" },\n"
+
"\n"
+
" init = function() {\n"
+
" defineInterval();\n"
+
" // Already over\n"
+
" if (isOver(cf.gmt_end)) {\n"
+
" return outOfInterval();\n"
+
" }\n"
+
"\n"
+
" run();\n"
+
" };\n"
+
"\n"
+
" init();\n"
+
"\n"
+
" return output;\n"
+
" };\n"
+
"\n"
+
" function isStarted(startTime) {\n"
+
" return +new Date() / 1000 >= startTime;\n"
+
" }\n"
+
"\n"
+
" function isOver(endTime) {\n"
+
" return +new Date() / 1000 >= endTime;\n"
+
" }\n"
+
" window.Countdown = Countdown;\n"
+
"})(window);\n"
+
"\n"
+
"\n"
+
"// 秒杀\n"
+
"var robSecondsKillWrap = $('.rob-seconds-kill-wrap');\n"
+
"var robSecondsKillTemplate = $('#j-seconds-kill');\n"
+
"var robCountdownTemplate = $('#j-count-down');\n"
+
"var robSecondsKillBtnTemplate = $('#j-seconds-kill-btn');\n"
+
"var countdown = Countdown;\n"
+
"\n"
+
"var sendApi = function(url, data, done, noDialog) {\n"
+
"\t$.ajax({\n"
+
"\t\turl: url,\n"
+
"\t\ttype: 'POST',\n"
+
"\t\tdataType: 'json',\n"
+
"\t\tdata: data,\n"
+
"\t\tsuccess: done,\n"
+
"\t\tnoDialog: noDialog,\n"
+
"\t\terror: function(e) {\n"
+
"\t\t\tconsole.log(e.message || '数据异常,请稍后重试');\n"
+
"\t\t},\n"
+
"\t\tcomplete: function(e) {\n"
+
"\t\t\t// do sth\n"
+
"\t\t}\n"
+
"\t});\n"
+
"};\n"
+
"\n"
+
"var robSecondsKill = {\n"
+
"\t list: null,\n"
+
"\t swiper: null,\n"
+
"\t /**\n"
+
"\t * 初始化秒杀\n"
+
"\t *\n"
+
"\t * @param {Number} index 索引\n"
+
"\t */\n"
+
"\t initSecondsKill: function(index) {\n"
+
"\t\t var titles = $('.seconds-title');\n"
+
"\t\t var currTitle = $(titles[+index]);\n"
+
"\t\t var contents = $('.seconds-kill-goods');\n"
+
"\t\t var currContent = $(contents[+index]);\n"
+
"\t\t var startTime = this.list[+index] && this.list[+index].startTime;\n"
+
"\t\t var startCountdown = parseInt(startTime / 1000, 10);\n"
+
"\t\t \n"
+
"\n"
+
"\t\t // 只有一个秒杀区间时,结束时间为24:00\n"
+
"\t\t // 有两个秒杀区间时,第一个秒杀结束时间为第二个秒杀开始时间,第二个秒杀结束时间为24:00\n"
+
"\t\t var endCountdown = startCountdown;\n"
+
"\t\t if (this.list.length === 2 && +index === 0) {\n"
+
"\t\t\t endCountdown = parseInt(this.list[+index + 1].startTime / 1000, 10);\n"
+
"\t\t }\n"
+
"\n"
+
"\t\t // 重置倒计时\n"
+
"\t\t titles.removeClass('active');\n"
+
"\t\t currTitle.addClass('active');\n"
+
"\t\t titles.find('.countdown').remove();\n"
+
"\t\t contents.hide();\n"
+
"\t\t currContent.show();\n"
+
"\n"
+
"\t\t this.swiper && this.swiper.destroy();\n"
+
"\t\t this.swiper = new Swiper('.seconds-kill-goods-' + index, {\n"
+
"\t\t\t slidesPerView: 'auto',\n"
+
"\t\t\t spaceBetween: 10,\n"
+
"\t\t\t freeMode: true\n"
+
"\t\t });\n"
+
"\n"
+
"\t\t var countdownTpl = '<div class=\"countdown\"></div>';\n"
+
"\t\t var countdownHtml = juicer(countdownTpl, {});\n"
+
"\n"
+
"\t\t var _this = this;\n"
+
"\n"
+
"\t\t currTitle.append(countdownHtml);\n"
+
"\t\t countdown({\n"
+
"\t\t\t selector: $('.countdown', currTitle),\n"
+
"\t\t\t leadingZeros: true,\n"
+
"\t\t\t gmt_begin: startCountdown,\n"
+
"\t\t\t gmt_end: endCountdown,\n"
+
"\t\t\t patternType: {\n"
+
"\t\t\t\t start: 2,\n"
+
"\t\t\t\t pre: 2\n"
+
"\t\t\t },\n"
+
"\t\t\t msgPrePatternBegin: '距开始',\n"
+
"\t\t\t msgStartPatternBegin: '距结束',\n"
+
"\t\t\t msgDayPattern: '',\n"
+
"\t\t\t msgHourPattern: '<span class=\"countdown-item\">{hours}</span><span class=\"split\">:</span>',\n"
+
"\t\t\t msgMinPattern: '<span class=\"countdown-item\">{minutes}</span><span class=\"split\">:</span>',\n"
+
"\t\t\t msgSecondPattern: '<span class=\"countdown-item\">{seconds}</span>'\n"
+
" });\n"
+
"\n"
+
" this.checkLogin(this, index);\n"
+
" },\n"
+
"\n"
+
" /**\n"
+
" * 检查登录\n"
+
" *\n"
+
" * @param {Object} _this 传入的this对象\n"
+
" * @param {Number} index 当前index值\n"
+
" */\n"
+
" checkLogin: function(_this, index) {\n"
+
" // 如果秒杀类型为秒杀专题则不检查登录和按钮状态并检查埋点\n"
+
" if (_this.list[+index].secondType === 'secondSubject') {\n"
+
" if(!_this.list[+index].hasShowLog) {\n"
+
" _this.list[index].hasShowLog = true;\n"
+
" setTimeout(function() {\n"
+
" window.DB && window.DB.statistics && window.DB.statistics.initLog();\n"
+
" }, 200);\n"
+
" }\n"
+
" } else {\n"
+
" // 监听请先登录按钮事件\n"
+
" if (global.uid === 'not_login') {\n"
+
" $('.j-seconds-btn-wrapper').html('<a href=\"javascript:void(0)\" class=\"activity-btn btn-border-red j-login-btn\" db-log=\"${stInfo}\">请先登录</a>')\n"
+
" $(document).off('click', '.j-login-btn');\n"
+
" $(document).on('click', '.j-login-btn', function(e) {\n"
+
" e.stopPropagation();\n"
+
" // 执行第三方APP登录\n"
+
" window.requirelogin();\n"
+
" return false;\n"
+
" });\n"
+
" } else {\n"
+
" // 获取并更新按钮状态\n"
+
" _this.renderBtnStatus(+index, _this.getActivityIds(_this.list[+index].seckillList));\n"
+
" }\n"
+
" }\n"
+
" },\n"
+
"\n"
+
"\n"
+
"\t /**\n"
+
"\t * 获取秒杀按钮状态,并更新\n"
+
"\t *\n"
+
"\t * @param {String} ids 需要查询的id\n"
+
"\t */\n"
+
"\t renderBtnStatus: function(index, ids) {\n"
+
"\t\t var _this = this;\n"
+
"\t\t sendApi('/seckill/getSeckillBtn', {\n"
+
"\t\t\t strSeckillIds: ids,\n"
+
"\t\t\t firstTime: this.list[+index].startTime\n"
+
"\t\t }, function(resp) {\n"
+
"\t\t\t var goodsWrap = $('.seconds-kill-goods-' + index);\n"
+
"\t\t\t var btnWrap = $('.j-seconds-btn-wrapper', goodsWrap);\n"
+
"\t\t\t var btnTpl = '{@if buttonType === 1}'+\n"
+
"\t\t\t\t\t\t\t'<a href=\"${creditsUrl}\" class=\"activity-btn btn-border-red\" db-log=\"${stInfo}\">赚'+global.cCreditsUnitName+'</a>'+\n"
+
"\t\t\t\t\t\t'{@else if buttonType === 2}'+\n"
+
"\t\t\t\t\t\t\t'<a href=\"javascript:void(0)\" class=\"activity-btn btn-gray\" db-log=\"${stInfo}\">'+global.cCreditsUnitName+'不足</a>'+\n"
+
"\t\t\t\t\t\t'{@else if buttonType === 3}'+\n"
+
"\t\t\t\t\t\t\t'<a href=\"${buttonLink}\" class=\"activity-btn btn-border-red\" db-log=\"${stInfo}\">即将开始</a>'+\n"
+
"\t\t\t\t\t\t'{@else if buttonType === 4}'+\n"
+
"\t\t\t\t\t\t\t'<a href=\"${buttonLink}\" class=\"activity-btn btn-gray\" db-log=\"${stInfo}\">已抢完</a>'+\n"
+
"\t\t\t\t\t\t'{@else if buttonType === 5}'+\n"
+
"\t\t\t\t\t\t\t'<a href=\"${buttonLink}\" class=\"activity-btn btn-red\" db-log=\"${stInfo}\">立即抢</a>'+\n"
+
"\t\t\t\t\t\t'{@/if}';\n"
+
"\t\t\t var btns;\n"
+
"\t\t\t var btnHtml;\n"
+
"\t\t\t var btnData;\n"
+
"\n"
+
"\t\t\t if (resp && resp.success) {\n"
+
"\t\t\t\t btns = resp.buts;\n"
+
"\t\t\t\t // render\n"
+
"\t\t\t\t for (var i = 0; i < btns.length; i++) {\n"
+
"\t\t\t\t\t btnData = btns[i];\n"
+
"\t\t\t\t\t btnData.creditsUrl = resp.creditsUrl;\n"
+
"\t\t\t\t\t btnHtml = juicer(btnTpl, btns[i]);\n"
+
"\n"
+
"\t\t\t\t\t $(btnWrap[i]).html('');\n"
+
"\t\t\t\t\t $(btnWrap[i]).append(btnHtml);\n"
+
"\t\t\t\t }\n"
+
"\t\t\t\t\n"
+
"\t\t\t\t if (!_this.list[index].hasShowLog) {\n"
+
"\t\t\t\t\t _this.list[index].hasShowLog = true;\n"
+
"\t\t\t\t\t window.DB && window.DB.statistics && window.DB.statistics.initLog();\n"
+
"\t\t\t\t }\n"
+
"\t\t\t }\n"
+
"\t\t });\n"
+
"\t },\n"
+
"\n"
+
"\t /**\n"
+
"\t * 获取秒杀活动id,拼成类似`1,2`的格式返回\n"
+
"\t */\n"
+
"\t getActivityIds: function(activities) {\n"
+
"\t\t activities = activities || [];\n"
+
"\n"
+
"\t\t var result = [];\n"
+
"\t\t result = activities.map(function(item) {\n"
+
"\t\t\t return {\n"
+
"\t\t\t\t duibaActivityId: item.activityId,\n"
+
"\t\t\t\t operatingActivityId: item.operatingActivityId\n"
+
"\t\t\t };\n"
+
"\t\t });\n"
+
"\t\t return JSON.stringify(result);\n"
+
"\t },\n"
+
"\n"
+
"\t /**\n"
+
"\t * 获取秒杀列表\n"
+
"\t */\n"
+
"\t renderSecondsKillList: function() {\n"
+
" var _this = this;\n"
+
"\n"
+
" if (data && data.length !== 0) {\n"
+
"\n"
+
" \n"
+
"\n"
+
" // 秒杀区间数据存下来,方便后面引用\n"
+
" _this.list = data.list;\n"
+
"\n"
+
" // 计算秒杀开始时间标题\n"
+
" for (var i = 0; i < _this.list.length; i++) {\n"
+
" var date = new Date(_this.list[i].startTime);\n"
+
" _this.list[i].title = date.getHours() + '点场';\n"
+
" if (_this.list[i].seckillList.length === 0) {\n"
+
" _this.list.splice(i, 1);\n"
+
" }\n"
+
" }\n"
+
"\n"
+
" if (_this.list.length === 0) {\n"
+
" return;\n"
+
" }\n"
+
"\t\t\t\n"
+
"\t\t\t\t // Webp图片优化\n"
+
"\t\t\t\t if (typeof ''.ossimg === 'function') {\n"
+
" \t\tfor (var i = 0;i < data.list.length;i++){\n"
+
"\t\t\t\t\tdata.list[i].seckillList = data.list[i].seckillList.imgWebpArray('image');\n"
+
"\t\t\t\t }\n"
+
" \t\t\t}\n"
+
"\n"
+
" // 渲染秒杀区间列表\n"
+
" $(\"#renderRoot\").append(juicer(html, yangzuo.extend(data, global)));\n"
+
"\n"
+
" // 每次切换秒杀区间重新初始化倒计时、按钮状态等\n"
+
" $('.seconds-title').on('click', function() {\n"
+
" var $target = $(this);\n"
+
" _this.initSecondsKill($target.data('index'));\n"
+
" });\n"
+
"\n"
+
" // 初始化第一个秒杀区间\n"
+
" _this.initSecondsKill(0);\n"
+
" } else {\n"
+
" $('.rob-seconds-kill-wrap').hide();\n"
+
" $('.top-bar').addClass('top-bar-border');\n"
+
" }\n"
+
" }\n"
+
" };\n"
+
"\n"
+
"robSecondsKill.renderSecondsKillList();"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤sckill"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
// 验证码
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
type
);
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
public
void
B_Seckill
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
Thread
.
sleep
(
60000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
String
source
=
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
);
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
String
operatingActivityId
=
"\"operatingActivityId\":(.*?),"
;
operatingActivityId
=
getMatcher
(
operatingActivityId
,
source
,
1
);
String
activityId
=
"\"activityId\":(.*?),"
;
activityId
=
getMatcher
(
activityId
,
source
,
1
);
String
image
=
"\"image\":\"(.*?)\","
;
image
=
getMatcher
(
image
,
source
,
1
);
String
url
=
"\"url\":\"(.*?)\"}"
;
url
=
getMatcher
(
url
,
source
,
1
);
Assert
.
assertEquals
(
activityId
,
"820"
,
""
);
Assert
.
assertEquals
(
image
,
"//yun.dui88.com/images/201801/7de9zo957y.png"
,
""
);
Assert
.
assertEquals
(
operatingActivityId
,
"25550"
,
""
);
Assert
.
assertTrue
(
url
.
contains
(
"//activity.m.duibatest.com.cn/SecondsKillActivity/index?id=25550"
));
}
@Test
public
void
C_Seckill
删除楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
response
.
prettyPrint
();
}
}
src/test/java/http/cases/FloorTest/Showcase_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevFloorShowcaseService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
/**
* Created by mabo on 2018/6/7
* 橱窗楼层
*/
public
class
Showcase_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
@Autowired
DevFloorShowcaseService
devFloorShowcaseService
;
private
String
skinId
=
null
;
private
String
floorId
=
null
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@BeforeClass
public
void
beforeClass
(){
try
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤Showcase"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboShowcase"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
}
@Test
public
void
A_Showcase
创建楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"8"
;
String
dataType
=
"0"
;
String
name
=
"maboShowcase"
;
String
skinWidth
=
"640"
;
String
html
=
"<section class=\"floor-showcase a-fadeinT\">\n"
+
" <a class=\"main-showcase\" href=\"${list[0].btnLink}\" db-log=\"${list[0].stInfo}\">\n"
+
" <img src=\"${list[0].image}\" alt=\"\">\n"
+
" {@if list[0].countDownTime}\n"
+
" <div class=\"showcase-countdown\">\n"
+
" <span>距开始</span><span class=\"countdown-time\">00:00:00</span>\n"
+
" </div>\n"
+
" {@/if}\n"
+
" </a>\n"
+
" <div class=\"side-showcase\">\n"
+
" <a href=\"${list[1].btnLink}\" db-log=\"${list[1].stInfo}\">\n"
+
" <div class=\"top-showcase\">\n"
+
" <img src=\"${list[1].image}\" alt=\"\">\n"
+
" </div>\n"
+
" </a>\n"
+
" <a href=\"${list[2].btnLink}\" db-log=\"${list[2].stInfo}\">\n"
+
" <div class=\"bottom-showcase\">\n"
+
" <img src=\"${list[2].image}\" alt=\"\">\n"
+
" </div>\n"
+
" </a>\n"
+
" </div>\n"
+
"</section>"
;
String
css
=
".floor-showcase {\n"
+
" width: 100%;\n"
+
" margin: 0.042666666666666665rem 0;\n"
+
" background: #fff;\n"
+
" position: relative;\n"
+
" border: solid #EEE;\n"
+
" border-width: 1px 0 ;\n"
+
" min-height: 1.0752rem;\n"
+
"}\n"
+
".floor-showcase a {\n"
+
" display: block;\n"
+
"}\n"
+
".floor-showcase img {\n"
+
" width: 100%;\n"
+
" height: 100%;\n"
+
"}\n"
+
".floor-showcase .main-showcase {\n"
+
" position: absolute;\n"
+
" left: 0;\n"
+
" top: 0;\n"
+
" bottom: 0;\n"
+
" width: 1.6042666666666667rem;\n"
+
" height: 1.0666666666666667rem;\n"
+
" overflow: hidden;\n"
+
" border-right: 1px solid #EEE;\n"
+
"}\n"
+
".floor-showcase .main-showcase .showcase-countdown {\n"
+
" display: none;\n"
+
" font-size: 0.1024rem;\n"
+
" position: absolute;\n"
+
" top: 0.49493333333333334rem;\n"
+
" left: 0.09386666666666667rem;\n"
+
" background: rgba(51, 51, 51, 0.9);\n"
+
" border-radius: 0.017066666666666667rem;\n"
+
" min-width: 0.6997333333333333rem;\n"
+
" height: 0.14933333333333335rem;\n"
+
" line-height: 0.14933333333333335rem;\n"
+
" padding: 0 0.021333333333333333rem;\n"
+
" text-align: center;\n"
+
" color: #FFF;\n"
+
" white-space: nowrap;\n"
+
" -webkit-transform: scale(0.9);\n"
+
" transform: scale(0.9);\n"
+
" -webkit-transform-origin: 0 0;\n"
+
" transform-origin: 0 0;\n"
+
" color: #979797;\n"
+
"}\n"
+
".floor-showcase .main-showcase .showcase-countdown .countdown-time {\n"
+
" margin-left: 0.017066666666666667rem;\n"
+
" color: #FFF;\n"
+
"}\n"
+
".floor-showcase .side-showcase {\n"
+
" padding-left: 1.6085333333333334rem;\n"
+
" overflow: hidden;\n"
+
"}\n"
+
".floor-showcase .side-showcase .top-showcase {\n"
+
" width: 1.5957333333333332rem;\n"
+
" height: 0.5333333333333333rem;\n"
+
" border-bottom: 1px solid #EEE;\n"
+
"}\n"
+
".floor-showcase .side-showcase .bottom-showcase {\n"
+
" width: 1.5957333333333332rem;\n"
+
" height: 0.5333333333333333rem;\n"
+
"}"
;
String
js
=
"if (data && data.list && data.list.length) {\n"
+
" if (data.list.length !== 3) return; // 橱窗位数据不为3不显示\n"
+
" var _list =[];\n"
+
" for (var i = 0; i < data.list.length; i++) {\n"
+
" _list[data.list[i].place - 1] = data.list[i];\n"
+
" }\n"
+
" data.list = _list;\n"
+
" $(\"#renderRoot\").append(juicer(html, data));\n"
+
" /**\n"
+
" * 橱窗倒计时\n"
+
" */\n"
+
" var caseCountDownTime = data.list[0].countDownTime;\n"
+
"\n"
+
" if (caseCountDownTime) {\n"
+
"\t$('.showcase-countdown').show();\n"
+
"\tvar date = new Date();\n"
+
"\tvar endTime = date.getFullYear() + '/' + (date.getMonth() + 1) + '/' +date.getDate() + ' ' + caseCountDownTime;\n"
+
"\tcountDown((new Date(endTime)).getTime()); \n"
+
" }\n"
+
"\n"
+
" function countDown(endTime) {\n"
+
"\tvar countDownTime = '';\n"
+
"\tcount();\n"
+
"\tfunction count() {\n"
+
"\t var now = (new Date()).getTime();\n"
+
"\t var t = endTime - now;\n"
+
"\t if (t <= 0) {\n"
+
"\t\t$('.showcase-countdown').hide();\n"
+
"\t\treturn;\n"
+
"\t }\n"
+
"\t var hour = Math.floor(t / 1000 / 60 / 60 % 24);\n"
+
"\t var min = Math.floor(t / 1000 / 60 % 60);\n"
+
"\t var second = Math.floor(t / 1000 % 60);\n"
+
"\t hour = hour < 10 ? '0' + hour : hour;\n"
+
"\t min = min < 10 ? '0' + min : min;\n"
+
"\t second = second < 10 ? '0' + second : second;\n"
+
"\t countDownTime = hour + ':' + min + ':' + second;\n"
+
"\t $('.showcase-countdown .countdown-time').text(countDownTime);\n"
+
"\t timer = setTimeout(function() {\n"
+
"\t\tcount();\n"
+
"\t }, 1000);\n"
+
"\t}\n"
+
" }\n"
+
"}"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤showcase"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
// 验证码
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
"8"
);
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
public
void
B_Showcase
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
Thread
.
sleep
(
60000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
List
<
Map
>
list
=
jsonPath
.
getList
(
"list"
,
Map
.
class
);
response
=
devFloorShowcaseService
.
getShowcaseContent
(
authorization
.
hdLoginmabo
(),
"18740"
);
List
<
Map
>
listDev
=
response
.
jsonPath
().
getList
(
"data"
,
Map
.
class
);
//开发者配置和手机端配置校验
for
(
int
i
=
0
;
i
<
listDev
.
size
();
i
++)
{
Assert
.
assertEquals
(
listDev
.
get
(
i
).
get
(
"relationTitle"
),
list
.
get
(
i
).
get
(
"relationTitle"
),
"relationTitle开发者配置和手机端展示不符"
);
Assert
.
assertEquals
(
listDev
.
get
(
i
).
get
(
"image"
),
list
.
get
(
i
).
get
(
"image"
),
"image开发者配置和手机端展示不符"
);
Assert
.
assertEquals
(
listDev
.
get
(
i
).
get
(
"relationImage"
),
list
.
get
(
i
).
get
(
"relationImage"
),
"relationImage开发者配置和手机端展示不符"
);
}
}
@Test
public
void
C_Showcase
删除楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
response
.
prettyPrint
();
}
}
src/test/java/http/cases/FloorTest/Sign_FloorTest.java
0 → 100644
View file @
535464a2
package
http
.
cases
.
FloorTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
http.service.Manager.FloorService
;
import
http.service.app.HomeService
;
import
http.service.hd.DevFloorBannerService
;
import
http.service.hd.DevSkinService
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
utils.MatcherString
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Map
;
import
static
io
.
restassured
.
path
.
json
.
JsonPath
.
from
;
/**
* Created by mabo on 2018/6/8
* 签到楼层
*/
public
class
Sign_FloorTest
extends
DuibaTestBase
{
@Autowired
HomeService
homeService
;
@Autowired
FloorService
floorService
;
@Autowired
Authorization
authorization
;
@Autowired
DevSkinService
devSkinService
;
@Autowired
DevFloorBannerService
devFloorBannerService
;
private
String
skinId
=
null
;
private
String
floorId
=
null
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@BeforeClass
public
void
beforeClass
(){
try
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
"mabo楼层皮肤Sign"
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?"
,
"maboSign"
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
}
catch
(
Exception
e
){
}
}
@Test
public
void
A_sign
创建楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
String
type
=
"11"
;
String
dataType
=
"0"
;
String
name
=
"maboSign"
;
String
skinWidth
=
"750"
;
String
html
=
"<section class=\"floor-top-floorsign\">\n"
+
" <div class=\"sign-box\">\n"
+
" <div class=\"add-credits\">{@if sign.canSign}今日签到可获得<span class=\"price\">${sign.credits}</span>元转豆{@else}明日签到可获得<span class=\"price\">${sign.nextCredits}</span>元转豆{@/if}</div>\n"
+
" {@if sign.canSign}\n"
+
" <div class=\"sign-text\" db-log=\"${sign.stInfo}\" id=\"sign-action\" data-can-sign=\"1\">签到</div>\n"
+
" {@else}\n"
+
" <div class=\"sign-text done\" db-log=\"${sign.stInfo}\" id=\"sign-action\" data-can-sign=\"0\">已签到</div>\n"
+
" {@/if}\n"
+
" </div>\n"
+
"\n"
+
" <div class=\"model\" style=\"display:none;\">\n"
+
" <div class=\"model-box\">\n"
+
" <div class=\"model-head\">\n"
+
" <div class=\"icon\"></div>\n"
+
" <div class=\"close-but\"></div>\n"
+
" </div>\n"
+
" <div class=\"model-body\">\n"
+
" <div class=\"model-title\">签到成功</div>\n"
+
" <div class=\"model-prompt\">明天签到可领取6转豆哦~</div>\n"
+
" </div>\n"
+
" <div class=\"model-footer\">\n"
+
" <div class=\"model-confirm\">确认</div>\n"
+
" </div>\n"
+
" </div>\n"
+
" </div>\n"
+
"\n"
+
" </section> "
;
String
css
=
".floor-top-floorsign {\n"
+
" width: 100%;\n"
+
" display: -webkit-box;\n"
+
" display: -ms-flexbox;\n"
+
" display: flex;\n"
+
" -webkit-box-orient: horizontal;\n"
+
" -webkit-box-direction: normal;\n"
+
" -ms-flex-direction: row;\n"
+
" flex-direction: row;\n"
+
" -webkit-box-pack: center;\n"
+
" -ms-flex-pack: center;\n"
+
" justify-content: center;\n"
+
"}\n"
+
".floor-top-floorsign .sign-box {\n"
+
" width: 13.952rem;\n"
+
" height: 3.41333333rem;\n"
+
" background-image: url('//yun.duiba.com.cn/h5/floor/sign/sign-in.png');\n"
+
" background-size: 100% 100%;\n"
+
" display: -webkit-box;\n"
+
" display: -ms-flexbox;\n"
+
" display: flex;\n"
+
" -webkit-box-orient: horizontal;\n"
+
" -webkit-box-direction: normal;\n"
+
" -ms-flex-direction: row;\n"
+
" flex-direction: row;\n"
+
" -webkit-box-pack: justify;\n"
+
" -ms-flex-pack: justify;\n"
+
" justify-content: space-between;\n"
+
"}\n"
+
".floor-top-floorsign .sign-box .add-credits {\n"
+
" margin-left: 3.15733333rem;\n"
+
" margin-top: 1.28rem;\n"
+
" font-size: 0.68266667rem;\n"
+
" font-weight: bold;\n"
+
" color: #fff;\n"
+
" letter-spacing: 0.04266667rem;\n"
+
" text-indent: 0.04266667rem;\n"
+
"}\n"
+
".floor-top-floorsign .sign-box .add-credits .price {\n"
+
" font-size: 1.06666667rem;\n"
+
" position: relative;\n"
+
" top: 0.08533333rem;\n"
+
" color: #fff16a;\n"
+
"}\n"
+
".floor-top-floorsign .sign-box .sign-text {\n"
+
" width: 2.00533333rem;\n"
+
" height: 2.00533333rem;\n"
+
" font-size: 0.59733333rem;\n"
+
" color: #ff5b5b;\n"
+
" font-weight: bold;\n"
+
" margin-right: 0.34133333rem;\n"
+
" margin-top: 0.832rem;\n"
+
" text-align: center;\n"
+
" line-height: 2.00533333rem;\n"
+
" letter-spacing: 0.08533333rem;\n"
+
" text-indent: 0.08533333rem;\n"
+
"}\n"
+
".floor-top-floorsign .sign-box .sign-text.done {\n"
+
" font-size: 0.46933333rem;\n"
+
" opacity: .7;\n"
+
"}\n"
+
"/*模态框*/\n"
+
".model {\n"
+
" width: 100%;\n"
+
" position: fixed;\n"
+
" top: 0;\n"
+
" bottom: 0;\n"
+
" background-color: rgba(0, 0, 0, 0.5);\n"
+
" z-index: 9999;\n"
+
" display: -webkit-box;\n"
+
" display: -ms-flexbox;\n"
+
" display: flex;\n"
+
" -webkit-box-pack: center;\n"
+
" -ms-flex-pack: center;\n"
+
" justify-content: center;\n"
+
" -webkit-box-align: center;\n"
+
" -ms-flex-align: center;\n"
+
" align-items: center;\n"
+
"}\n"
+
".model .model-box {\n"
+
" width: 13.65333333rem;\n"
+
" height: 8.61866667rem;\n"
+
" background-color: #fff;\n"
+
" border-radius: 8px;\n"
+
"}\n"
+
".model .model-box .model-head {\n"
+
" width: 100%;\n"
+
" height: 2.688rem;\n"
+
" display: -webkit-box;\n"
+
" display: -ms-flexbox;\n"
+
" display: flex;\n"
+
" -webkit-box-orient: horizontal;\n"
+
" -webkit-box-direction: normal;\n"
+
" -ms-flex-direction: row;\n"
+
" flex-direction: row;\n"
+
" -webkit-box-pack: end;\n"
+
" -ms-flex-pack: end;\n"
+
" justify-content: flex-end;\n"
+
" position: relative;\n"
+
"}\n"
+
".model .model-box .model-head .icon {\n"
+
" width: 4.11733333rem;\n"
+
" height: 4.20266667rem;\n"
+
" position: absolute;\n"
+
" left: 50%;\n"
+
" background-image: url('img/xiong-icon.png');\n"
+
" margin-left: -2.05866667rem;\n"
+
" margin-top: -2.32533333rem;\n"
+
" background-size: 100% 100%;\n"
+
"}\n"
+
".model .model-box .model-head .close-but {\n"
+
" width: 0.512rem;\n"
+
" height: 0.512rem;\n"
+
" margin: 0.512rem 0.512rem 0 0;\n"
+
" background-size: 100% 100%;\n"
+
" background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAOVBMVEUAAACqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrmqrrm/77LuAAAAEnRSTlMAKPLA5jwKmwyeOemfYUSgYxqFJioEAAAAcklEQVQoz23RSQ7AIAxDUUNHSqFt7n/YEgnJksGLLN5fBkDFsN3Pa4/6uRztXtFudVu/XtQDwCLeS1JnGZ2Fzm1e6FLoUrL7uGpmM9+XFtLU1xLtmHnA1os6WMR7UWehZ3cWdRZ1FrqUghDpLMlf4T7uB2WsBggrQzA4AAAAAElFTkSuQmCC');\n"
+
"}\n"
+
".model .model-box .model-body {\n"
+
" width: 100%;\n"
+
" height: 3.84rem;\n"
+
" text-align: center;\n"
+
"}\n"
+
".model .model-box .model-body .model-title {\n"
+
" font-size: 0.64rem;\n"
+
" color: #44484c;\n"
+
" padding: 0.42666667rem 0;\n"
+
"}\n"
+
".model .model-box .model-body .model-prompt {\n"
+
" font-size: 0.512rem;\n"
+
" color: #a9afb8;\n"
+
" padding: 0.42666667rem 0;\n"
+
"}\n"
+
".model .model-box .model-footer {\n"
+
" width: 100%;\n"
+
" height: 2.048rem;\n"
+
" line-height: 2.048rem;\n"
+
" text-align: center;\n"
+
" border-top: 0.02133333rem solid #e7e7e7;\n"
+
"}\n"
+
".model .model-box .model-footer .model-confirm {\n"
+
" width: 100%;\n"
+
" height: 100%;\n"
+
" font-size: 0.64rem;\n"
+
" color: #6da6fe;\n"
+
"}\n"
+
"/***弹出层***/\n"
+
".report-modal-sign {\n"
+
" display: none;\n"
+
" position: fixed;\n"
+
" top: 0;\n"
+
" right: 0;\n"
+
" bottom: 0;\n"
+
" left: 0;\n"
+
" background-color: rgba(0, 0, 0, 0) !important;\n"
+
" z-index: 999;\n"
+
"}\n"
+
".report-modal-sign .dialog-sign {\n"
+
" position: absolute;\n"
+
" top: 7.5rem;\n"
+
" left: 50%;\n"
+
" -webkit-transform: translate(-50%, 0);\n"
+
" transform: translate(-50%, 0);\n"
+
" width: 7.175rem;\n"
+
" height: 8.225rem;\n"
+
" background-size: 100% 100%;\n"
+
" text-align: center;\n"
+
" -webkit-background-position-y: -0.5rem;\n"
+
" background-position-y: -0.5rem;\n"
+
" background-color: rgba(0, 0, 0, 0.6);\n"
+
" border-radius: 0.25rem;\n"
+
"}\n"
+
"/**签到服务**/\n"
+
".report-modal-sign .signSuccess {\n"
+
" background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR8AAAFJCAMAAACVXtmVAAAC9FBMVEUAAAD///+QwaMr4Th2mMWBsNzujbXujbTvkb3g+M+Kw+/ujbTujbTujbR2mMWKw+8r4TiKw++Kw+/ujbQr4Tgr4Tilu9nV4O7zrcrujbR2mMYr4TiKw++Kw+92mMX8/aqp/cn8/ap2mMXujbR2mMX///92mMUr4TjujbSKw+8r4TjujbQr4TiCocrxnsDy9frl5eWp/cmKw+8r4TiKw+/l5eWKw++Kw++xxN77/P7/3T/////ujbTzr8v////wqv3ujbTujbSKw+8r4Tj/3T//3T+Kw+/ujbTl5eV2mMX/3T/l5eV2mMXl5eWKw+////+Kw+//////3T/ujbSp/cn8/ar/3T8r4Tjy8vKp/cn8/arujbT/3T/w8PB3zILl5eXl5eWQr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ej0W7GbzsrsHqfUrlOQH3OZ5R6ON26AtMe1WjHGSKFQa6fTNWYXi81A2wF+8rjP18/FfrLjVbxZ78efwS2yhT93Uk53uLp7f2U4P1rfMQE20tKv3a9Lvu0icigt/nn4PPPi5tOzxnPmE5j8np/lsigl/dTeDKdBVQE20gFLC3q812O5dPL+yls3uuvsQJYTDumKvU7dI5IoYf3U7ie046pEcPpSlPU7xSRQy/vp7D57//UTLA8ekB/kf7+T4j+zDXpvSV2E8B0Ds0Snn56ez+Fx3//eawJ9+J1//lf5ak3oHy8nl/8M6NGgxwj0pgBfdeM9fPTYPj8Hec3cP4H58einA8YeZw/5DMncX6Vz/iM889BmoXK5OhkjObnByQ271+4MB/MB/PBfLwwHyH2bJ+J+bAdWN/eivmwbWm3d2E+TLva7S3Yf9i2ttcfwHzYZm7fg/tXSKeB47UiyiISUdz180ERJUkiaidwrFNEWUIiajlwPFNEmUMi6qAOTPW7iigrSFQdB6bHiijJ6N565XzA7iiiLCXRtREYFiqiJGeR6NqnM7qPuOWzjEQZY4tfoLD9J5sX74z4RBFlW3Sbs2MH+Kni4pkT+XgIWX4EPC4LOxkmo917XLN3bIBf0k9EHQyTS6O8c3nMXD5j4wZdfXXp9TMh6SxKLpmzQoKPFkIIIYQQQgghhBBCCCGEEEII/WgPDgQAAAAABPlbrzBABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT3kZS0gfutqiAAAAAElFTkSuQmCC');\n"
+
"}\n"
+
".report-modal-sign .signFail {\n"
+
" background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAAFHCAMAAABAltPbAAACNFBMVEUAAAD////Z5PHX4vDc5vLW4vCWsNPV4fDW4vDW4vDW4vB2mMXW4vDW4vDW4vDW4vDW4vDW4vDW4vDW4vDW4vDW4vDW4vDc5vPW4vDW4vDW4vD8ERHW4vB2mMX8ERH8ERHX4/DW4vDW4vDW4vB2mMXW4vDW4vCnvdr///92mMZ2mMXW4vDW4v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C86rzkofbwFJrH0hc5Av17mNNZPPxHZfZvIml1o61kpXnCY9B6+1cp9OZe9viCltZioXv7V/W8KTosm25zkKIZ3xYDqR2XXYdgiBjNx+WpWlPh7Gx49An94APyebUdjx+yw7thZ78s7t8ONZvSPGe1Wfx2MF9e28a9y89ej6UcNat3790dfrnFSGEEEIIIYQQQgghhBBCyK/24EAAAAAAQJC/9SBXAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADATNYG1mx06Yo4AAAAASUVORK5CYII=');\n"
+
"}\n"
+
".report-modal-sign .signAgain {\n"
+
" background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR8AAAFJCAMAAACVXtmVAAAC8VBMVEUAAAD////kloOSwNt2mMWlubr/ZgHxqMDujbR2mMXujbTujbTujbSKw+//ZgHujbSSrdGKw++Kw+/ujbT/ZgF2mMX/ZgGyxd+mvNrzr8t2mMaKw+/l5eWKw+/ujbTwqv3/3T92mMX////ujbTujbSKw+/P2+vyqMbxnsDujbT09/r+///zqsiKw++p/cn8/ar/ZgGKw+////+Kw+92mMX/ZgH/ZgHl5eWKw++Kw+/09PT/ZgHwqv2p/cl/n8n8/arl5eX/ZgHujbT////ujbSKw+92mMV2mMXujbTujbSKw+/ujbR2mMX/ZgHwqv2p/cn8/arl5eXwqv2p/cn8/aqKw+/zr8v/3T/ujbTwqv2p/cn8/ar/3T/////y8vLwqv2p/cn8/ar/ZgH/3T/s8PXujbTnkbj/3T//3T////+xxN7b5PDl5eX8/aqp/cn////l5eX+awvl5eX/3T//3T/l5eXl5eXl5eXl5eWKw+/l5eWKw+/////////l5eX///92mMXujbT/ZgGKw+/8/f7o7vXk6/Tt8fjw8/j/uozq8PbW4O3l7PT+/v7x9Pnn5+fQ5PH/z+Lh6PL/rnj8/Pz39/fs7Oz/t4bp6en/4s3/x6Lwqv3v8/n/vZD//fzw8PD/zeH/dhv5+fnflr7/1rzokbj/+vf09PSNw+72qsj/lE3/+PPy8vKt1PLW4O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+hAXX/Z8eu4ji37h/yTbUXaptAdT9l44rF9fb6Yd9/vvmtpz5Duv+8vlgcV+aUH5wyXN8hNYfjijt3IMf8iI8M+sMLkJ5/9T+0ycn9LfXZPsZPCEhv2KefB1xJtHeZ9odd7ZyO0cijzHTAD9fRZdIfdnVwesqRR5mATRjJlUh7I8+isZ0zYCnyKJuxCUO4Uml7x9Dzro0zYiDyKPNEzOQ29w90NhoNnk7OmGHIq+zDTCZx/8Kr1sY/7bS+4owp74+8yklbpxfN67fveY33b19zTMYjz1K2BDM4z9lAW0dna2trZ0cbZ0K5l//7b4vIqD53ObeYhbzMBNbi7hRgFi+zHnEE5xbLvVucVcr0I4i4p2egty9Wezi1G1OcHcK5RLl3Ox+qTZwwFf8i6trgKR/v5ZWLov/mmUumiuRD5YPnnBuMLl86cJjXK09AQEBAQMCP9uBAAAAAAECQv/UgVwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsBTowPWa7HE1pQAAAABJRU5ErkJggg==');\n"
+
"}\n"
+
"/*******/\n"
+
".report-modal-sign .dialog-sign p {\n"
+
" display: block;\n"
+
" text-align: center;\n"
+
" color: #fff;\n"
+
"}\n"
+
".report-modal-sign .dialog-sign p.signTip-sign {\n"
+
" font-size: 0.65rem;\n"
+
" margin-top: 5.25rem;\n"
+
" margin-bottom: 0.25rem;\n"
+
"}\n"
+
".report-modal-sign .dialog-sign p.nextText-sign {\n"
+
" font-size: 0.7rem;\n"
+
"}\n"
+
".report-modal-sign .dialog-sign p.nextTextColor {\n"
+
" color: #e97883;\n"
+
"}\n"
+
".ddmx {\n"
+
" color: #cecece;\n"
+
" font-size: 0.45rem;\n"
+
" padding-top: 0.25rem;\n"
+
"}"
;
String
js
=
";(function(window,undefined){\n"
+
" 'use strict';\n"
+
"\n"
+
" var modelBox = {\n"
+
" init:function(){\n"
+
" var _this = this;\n"
+
" this.modelEle = $('.model');\n"
+
" this.prompt = $('.model-prompt');\n"
+
" this.title = $('.model-title');\n"
+
"\n"
+
" $('.model-confirm').on('click',function(){\n"
+
" _this.hide();\n"
+
" });\n"
+
"\n"
+
" $('.close-but').on('click',function(){\n"
+
" _this.hide();\n"
+
" });\n"
+
"\n"
+
" },\n"
+
" show:function(){\n"
+
" this.modelEle.show();\n"
+
" return this;\n"
+
" },\n"
+
" hide:function(){\n"
+
" this.modelEle.hide();\n"
+
" return this;\n"
+
" },\n"
+
" closeModel:function(callback,time){\n"
+
" var times,\n"
+
" _this = this;\n"
+
"\n"
+
" if(typeof callback === 'number')\n"
+
" time = callback;\n"
+
" time = time || 1500;\n"
+
" //定时关闭模态框\n"
+
" times = setTimeout(function(){\n"
+
" _this.hide();\n"
+
" },time);\n"
+
"\n"
+
" return this;\n"
+
" },\n"
+
" setTitle:function(text){\n"
+
" this.title.text(text);\n"
+
" return this;\n"
+
" },\n"
+
" setPrompt:function(text){\n"
+
" this.prompt.text(text);\n"
+
" return this;\n"
+
" }\n"
+
" };\n"
+
"\n"
+
" modelBox.init();\n"
+
" /**\n"
+
" * 签到服务\n"
+
" */\n"
+
" SignService.$inject = [\"$q\", \"$http\", \"$Interval\"];\n"
+
" function SignService($q, $http, $Interval) {\n"
+
" var SIGN_URL = \"/sign/doSign\";\n"
+
" var GET_SIGN_RESULT_URL = \"/sign/signResult\";\n"
+
" var TIME = 8; //重复获取次数\n"
+
"\n"
+
" var SIGN_STATUE_WITE = 0;\n"
+
" var SIGN_STATUE_SUCCESS = 1;\n"
+
" var SIGN_STATUE_ERROR = 2;\n"
+
"\n"
+
" function doSign() {\n"
+
" var promiss = $q.defer();\n"
+
" $http.jsonp(SIGN_URL).then(resolve, reject);\n"
+
" function resolve(result) {\n"
+
" if (result.success) {\n"
+
" getSignResult(promiss);\n"
+
" } else {\n"
+
" promiss.reject(result.message);\n"
+
" }\n"
+
" }\n"
+
" function reject(message) {\n"
+
" promiss.reject(message);\n"
+
" }\n"
+
" return promiss.promise;\n"
+
" }\n"
+
"\n"
+
" function getSignResult(promiss) {\n"
+
" var i = 1;\n"
+
" var hasResult = false;\n"
+
" var p = $Interval(function () {\n"
+
" $http.jsonp(GET_SIGN_RESULT_URL).then(function (result) {\n"
+
" if (hasResult) {\n"
+
" return;\n"
+
" }\n"
+
" if (result.state != SIGN_STATUE_WITE) {\n"
+
" $Interval.cancel(p);\n"
+
" }\n"
+
" if (result.state == SIGN_STATUE_SUCCESS) {\n"
+
" hasResult = true;\n"
+
" var ru = {};\n"
+
" yangzuo.extend(ru, result);\n"
+
" promiss.resolve(ru);\n"
+
" return;\n"
+
" }\n"
+
" if (result.state == SIGN_STATUE_ERROR) {\n"
+
" hasResult = true;\n"
+
" promiss.reject(result.message);\n"
+
" return;\n"
+
" }\n"
+
" promiss.notify(i);\n"
+
" i++;\n"
+
" }, function (message) {\n"
+
" promiss.reject(message);\n"
+
" $Interval.cancel(p);\n"
+
" });\n"
+
" }, 400, TIME);\n"
+
" }\n"
+
" return {\n"
+
" doSign: doSign\n"
+
" }\n"
+
" }\n"
+
" yangzuo.service(\"NewSignService\", SignService);\n"
+
" var sign = data;\n"
+
" var timer;\n"
+
" var model = {};\n"
+
" model.sign = sign;\n"
+
" yangzuo.extend(model, global);\n"
+
" $(\"#renderRoot\").append(juicer(html, model));\n"
+
"\n"
+
" yangzuo.on(\"updateCreditsAndRecord\", function (event) {\n"
+
" if (event.credits == 0 || event.credits) {\n"
+
" $(\"#db-credits-num\").text(event.credits);\n"
+
" }\n"
+
" if (event.status) {\n"
+
" $('#db-new-record,#db-new-tip').show();\n"
+
" } else {\n"
+
" $('#db-new-record,#db-new-tip').hide();\n"
+
" }\n"
+
" });\n"
+
"\n"
+
" if (data.canSign) {\n"
+
" yangzuo.element(\"#sign-action\").on(\"click\", function () {\n"
+
" yangzuo.injectExecute(Dosign);\n"
+
" })\n"
+
" }\n"
+
" Dosign.$inject = [\"NewSignService\"]\n"
+
" function Dosign(SignService) {\n"
+
" var signText = $('.sign-text');\n"
+
" //如果data-can-sign等于0那么将不能签到\n"
+
" if (signText.data('canSign') === '0') {\n"
+
" console.log('已签到!');\n"
+
" return;\n"
+
" }\n"
+
" SignService.doSign().then(function (result) {\n"
+
" console.log(\"签到成功:\" + yangzuo.toJson(result));\n"
+
"\n"
+
" $('.add-credits').html('<p>明日签到可获得<span class=\"price\">'+ sign.nextCredits + '</span>元转豆</p>');\n"
+
" signText.text('已签到');\n"
+
" signText.addClass('done');\n"
+
" yangzuo.post(\"$onDBNewOpenBack\");\n"
+
" \n"
+
" //设置model参数和状态\n"
+
" modelBox.setTitle('签到成功')\n"
+
" .setPrompt('明日签到可获得' + sign.nextCredits + '元转豆')\n"
+
" .show();\n"
+
" }, function (message) {\n"
+
" console.log(\"签到失败:\",message);\n"
+
" $('.add-credits').html('<p>明日签到可获得<span class=\"price\">'+ sign.nextCredits + '</span>元转豆</p>');\n"
+
" modelBox.setTitle('签到失败')\n"
+
" .setPrompt('网络不通畅')\n"
+
" .show();\n"
+
"\n"
+
" })\n"
+
" }\n"
+
"\n"
+
"})(window,void 0);"
;
//新建banner楼层
Response
response
=
floorService
.
createFloor
(
authorization
.
ssoLogin
(),
type
,
dataType
,
name
,
html
,
css
,
js
,
skinWidth
);
Map
<
String
,
Object
>
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_code where floor_name=?"
,
name
);
floorId
=
String
.
valueOf
(
map
.
get
(
"id"
));
String
nameSkin
=
"mabo楼层皮肤sign"
;
String
image
=
"//yun.dui88.com/images/201805/nlkmslg0t0.png"
;
// 验证码
String
stoke
=
"1"
;
// String floors = "[{\"id\":190,\"name\":\"maboTest\",\"type\":1,\"dataType\":0,\"needSyn\":false,\"syn\":false}]";
String
ower
=
"0"
;
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
map
.
get
(
"id"
));
json
.
put
(
"name"
,
name
);
json
.
put
(
"type"
,
type
);
json
.
put
(
"dataType"
,
map
.
get
(
"data_type"
));
json
.
put
(
"needSyn"
,
false
);
json
.
put
(
"syn"
,
false
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
json
);
String
floors
=
jsonArray
.
toJSONString
();
//新建皮肤
response
=
floorService
.
insertSkin
(
authorization
.
ssoLogin
(),
nameSkin
,
image
,
stoke
,
floors
,
ower
,
skinWidth
);
map
=
jdbc
.
findSimpleResult
(
"select * from credits_dev.tb_credits_floor_skin where skin_name = ?"
,
nameSkin
);
skinId
=
String
.
valueOf
(
map
.
get
(
"id"
));
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
public
void
B_sign
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
skinId
);
Thread
.
sleep
(
60000
);
JsonPath
jsonCfg
=
homeService
.
getCFG
(
2753
);
Assert
.
assertEquals
(
jsonCfg
.
getList
(
""
).
size
(),
1
,
"banner展示数量和配置不符"
);
String
floorId
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorId=(.*?),"
,
1
);
String
dataType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"dataType=(.*?),"
,
1
);
String
floorType
=
MatcherString
.
getString
(
jsonCfg
.
getList
(
""
).
get
(
0
).
toString
(),
"floorType=(.*?),"
,
1
);
response
=
homeService
.
floor
(
authorization
.
dafuwengLogin
(
2753
),
floorType
,
dataType
,
"3"
,
floorId
);
String
s
=
response
.
asString
();
JsonPath
jsonPath
=
from
(
s
.
substring
(
s
.
indexOf
(
"{"
),
s
.
length
()-
1
));
String
credits
=
jsonPath
.
getString
(
"credits"
);
Assert
.
assertEquals
(
credits
,
"1"
,
"积分与期望不符"
);
}
@Test
public
void
C_sign
删除楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
Response
response
=
devSkinService
.
saveSkin
(
authorization
.
hdLoginmabo
(),
"18740"
,
"198"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteSkin
(
authorization
.
ssoLogin
(),
skinId
,
"1"
);
response
.
prettyPrint
();
response
=
floorService
.
deleteFloor
(
authorization
.
ssoLogin
(),
floorId
);
response
.
prettyPrint
();
}
}
src/test/java/utils/StringUtil.java
0 → 100644
View file @
535464a2
package
utils
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Random
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
/**
* Created by hanzhanli on 2017/8/16.
*/
public
class
StringUtil
{
public
static
String
generateStringByTime
(){
Date
date
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"MMdd"
);
return
sdf
.
format
(
date
)+
"-"
+(
int
)(
Math
.
random
()*
100
);
}
public
static
String
generateRandomString
(
int
length
)
{
String
str
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
;
Random
random
=
new
Random
();
StringBuffer
buf
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
int
num
=
random
.
nextInt
(
36
);
buf
.
append
(
str
.
charAt
(
num
));
}
return
buf
.
toString
();
}
public
static
String
getMatcher
(
String
regex
,
String
source
,
int
index
)
{
String
result
=
""
;
Pattern
pattern
=
Pattern
.
compile
(
regex
);
Matcher
matcher
=
pattern
.
matcher
(
source
);
if
(
matcher
.
find
())
{
result
=
matcher
.
group
(
1
);
}
return
result
;
}
public
static
void
main
(
String
[]
args
)
{
String
s
=
"{\"code\":\"0\",\"desc\":\"获取标签成功\",\"data\":{\"matchTagNums\":[\"20101\"],\"bannedTagNums\":[\"30101\"],\"promoteURLTagNums\":[\"40101\"],\"materialTagNums\":[\"50101\"]}}"
;
String
source
=
"\"matchTagNums\":[\"(.*?)\"]"
;
System
.
out
.
println
(
getMatcher
(
source
,
s
,
1
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment