Authored by 李犇

场景编排优化——review by 陈林

... ... @@ -5,38 +5,31 @@ const {
module.exports = {
[ANDROID_ORDER_CONFIRM]: [
{ op: 'YB_PAGE_ENTER', name: '进入商品详情页', equals: { PAGE_ID: 'spxqy' } },
{
op: 'YB_GDS_DT_INFO', name: '请求商品数据成功', validate: (log) => {
return log.param.PRD_SKN.length > 0;
}
},
{
op: 'YB_GDS_COLOR_C', name: '点击颜色(可以没有 如果只有一个颜色是不可点击的)', validate: (log) => {
return log.param.PRD_ID.length > 0 && log.param.COLOR.length > 0;
}
},
{
op: 'YB_GDS_SIZE_C', name: '点击尺码(可以没有 如果只有一个尺码是不可点击的)', validate: (log) => {
return log.param.PRD_ID.length > 0 && log.param.SIZE.length > 0;
}
},
{
op: 'YB_GDS_DT_SEL', name: '加入购物车', validate: (log) => {
return log.param.PRD_SKU > 0;
}
},
{ op: 'YB_FUNC_SC_DRIFT', name: '进入购物车'},
{
op: 'YB_GDS_DT_BUY', name: '商品加入购物车', validate: (log) => {
return log.param.PRD_ID.length > 0;
}
},
{op: 'YB_CHOOSE_FOR_YOU', name: '购物车猜你喜欢'},
{ op: 'YB_SHOW_SHOPCART', name: '普通购物车数量'},
{ op: 'YB_SHOW_GLOBAL_SHOPCART', name: '全球购购物车数量'},
{
op: 'YB_CHOOSE_FOR_YOU', name: '店铺推荐的商品列表', equals: { REC_POSE: '100029', ACTION_ID: '0' }, validate: (log) => {
return log.param.PRD_ID.length > 0;
}
},
{
op: 'YB_GDS_DT_BUY', name: '点击商品详情', validate: (log) => {
return log.param.PRD_ID.length > 0;
}
},
{ op: 'YB_SC_TOPAY', name: '订单生成'},
{ op: 'YB_PAGE_ENTER', name: '进入确认订单页', equals: { PAGE_ID: 'qrdd' } },
{ op: 'YB_SC_ORD', name: '订单确认', validate: (log) => {
return log.param.ORD_NUM.length > 0;
}},
{ op: 'YB_PAGE_EXIT', name: '离开订单页', equals: { PAGE_ID: 'qrdd' } },
{ op: 'YB_PAGE_ENTER', name: '进入支付选择页', equals: { PAGE_ID: 'zfzx' } },
{ op: 'YB_PAGE_FINISH', name: '关闭确认订单页', equals: { PAGE_ID: 'qrdd' } },
{ op: 'YB_SC_PAY', name: '支付', validate: (log) => {
return log.param.ORD_NUM.length > 0;
}},
{ op: 'YB_PAGE_EXIT', name: '离开支付页', equals: { PAGE_ID: 'zfzx' } },
]
};
... ...
... ... @@ -11,16 +11,11 @@ module.exports = {
return log.param.PRD_SKN.length > 0;
}
},
{
op: 'YB_GDS_COLOR_C', name: '点击颜色(可以没有 如果只有一个颜色是不可点击的)', validate: (log) => {
return log.param.PRD_ID.length > 0 && log.param.COLOR.length > 0;
}
},
{
/*{
op: 'YB_GDS_SIZE_C', name: '点击尺码(可以没有 如果只有一个尺码是不可点击的)', validate: (log) => {
return log.param.PRD_ID.length > 0 && log.param.SIZE.length > 0;
}
},
},*/
{
op: 'YB_GDS_DT_SEL', name: '加入购物车', validate: (log) => {
return log.param.PRD_SKU > 0;
... ... @@ -47,9 +42,7 @@ module.exports = {
// },
//店铺推荐的商品列表
{
op: 'YB_CHOOSE_FOR_YOU', name: '店铺推荐的商品列表', equals: { REC_POSE: '100029', ACTION_ID: '0' }, validate: (log) => {
return log.param.PRD_ID.length > 0;
}
op: 'YB_CHOOSE_FOR_YOU', name: '店铺推荐的商品列表'
},
// //点击店铺推荐的商品列表
// {
... ... @@ -58,12 +51,6 @@ module.exports = {
// }
// },
//点击商品详情
{
op: 'YB_GDS_DT_BUY', name: '点击商品详情', validate: (log) => {
return log.param.PRD_ID.length > 0;
}
},
// //点击在线客服
// { op: 'YB_MY_OLCS', name: '点击在线客服', equals: { TYPE: '1' } },
// //立即购买
... ...
... ... @@ -34,11 +34,9 @@ module.exports = {
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2073', equals: { SUB_C_ID:'2073'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1951', equals: { SUB_C_ID:'1951'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1469', equals: { SUB_C_ID:'1469'}},
//{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光3', equals: { SUB_C_ID:'3'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1', equals: { CHANNEL_ID: '1', SUB_C_ID:'1'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel2', equals: { CHANNEL_ID: '2', SUB_C_ID:'2'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel3', equals: { CHANNEL_ID: '3', SUB_C_ID:'3'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel2073', equals: { CHANNEL_ID: '2073', SUB_C_ID:'2073'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1951', equals: { CHANNEL_ID: '1951', SUB_C_ID:'1951'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1469', equals: { CHANNEL_ID: '1469', SUB_C_ID:'1469'}},
... ...
... ... @@ -4,15 +4,16 @@ const {
module.exports = {
[ANDROID_TAB_MINE]:[
{op: 'UFO_MY_ITEM_C', name: '我的收入'},
// {op: 'UFO_MY_ITEM_C', name: '商家入驻'},
// {op: 'UFO_MY_ITEM_C', name: '新的好物'},
// {op: 'YB_PAGE_ENTER', name: '新的好物载入'},
// {op: 'YB_PAGE_EXIT', name: '新的好物载出'},
// {op: 'YB_PAGE_ENTER', name: '商家入驻载入'},
// {op: 'YB_PAGE_EXIT', name: '商家入驻载出'},
{op: 'YB_PAGE_ENTER', name: '我的收入载入'},
{op: 'YB_PAGE_EXIT', name: '我的收入载出'},
{op: 'YB_CPS_MAIN_PRO_TAB_C', name: '有货有赚推荐'},
{op: 'YB_PAGE_ENTER', name: 'UFO载入'},
{op: 'YB_PAGE_ENTER', name: 'UFO载出'},
// {op: 'YB_H5_PAGE_OPEN_', name: '新的好物url'},
... ...
... ... @@ -4,44 +4,32 @@ const {
module.exports = {
[ANDROID_MAINTAB_SWITCH]:[
{op: 'YB_LAUNCH_APP', name: '启动app', single: true},
{op: 'YB_ENTER_CHOICE', name: '性别男女入口', single: true, validate: (log) => {
return ((log.param.ENT_TYP === 1 && log.param.SUB_C_ID === '1' && log.param.C_ID === '1')
|| (log.param.ENT_TYP === 0 && log.param.SUB_C_ID === '2' && log.param.C_ID === '2'));
}},
{op: 'YB_PAGE_ENTER', name: '欢迎页载入', equals: { PAGE_ID: 'start' }},
{op: 'YB_PAGE_EXIT', name: '欢迎页载出', equals: { PAGE_ID: 'start' }},
{op: 'YB_PAGE_FINISH', name: '欢迎页关闭', equals: { PAGE_ID: 'start' }},
{op: 'YB_PAGE_ENTER', name: '频道选择页载入', equals: { PAGE_ID: 'xbxzy' }},
{op: 'YB_PAGE_EXIT', name: '频道选择页载出', equals: { PAGE_ID: 'xbxzy' }},
{ op: 'YB_CATEGORY', name: 'TAB BAR 点击品类'},
{op: 'YB_PAGE_ENTER', name: '品类进入', equals: { PAGE_ID: 'pl' }},
{ op: 'YB_PAGE_EXIT', name: "离开首页", equals: { PAGE_ID: "sy" } },
{ op: 'YB_AUTO_TRACK', name: '自动点击TAB品类上报'},
{ op: 'YB_PAGE_ENTER', name: "进入品类", equals: { PAGE_ID: "pl" } },
{op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1', equals: { CHANNEL_ID: '1', SUB_C_ID:'1'}},
{ op: 'YB_STROLL', name: 'TAB BAR 点击逛'},
{ op: 'YB_AUTO_TRACK', name: '自动点击TAB逛上报'},
{ op: 'YB_PAGE_EXIT', name: "离开品类", equals: { PAGE_ID: "pl" } },
{op: 'YB_PAGE_ENTER', name: '逛进入', equals: { PAGE_ID: 'guangsy' }},
{op: 'YB_STROLL_MAIN_TAB_C', name: '逛推荐tab', single: true, validate: (log) => {
return log.param.TAB_ID === "1001";
}},
/*{op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1469', types:{DATA: Array}, equals: { SUB_C_ID:'1469'}},
{op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光2073', types:{DATA: Array}, equals: { SUB_C_ID:'2073'}},
{op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1951', types:{DATA: Array}, equals: { SUB_C_ID:'1951'}},
{op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1', types:{DATA: Array}, equals: { SUB_C_ID:'1'}},
{op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光2', types:{DATA: Array}, equals: { SUB_C_ID:'2'}},
{op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光3', types:{DATA: Array}, equals: { SUB_C_ID:'3'}},*/
{ op: 'YB_MY', name: 'TAB BAR 点击个人中心'},
{ op: 'YB_AUTO_TRACK', name: '自动点击TAB个人中心上报'},
{ op: 'YB_PAGE_EXIT', name: "离开逛", equals: { PAGE_ID: "guangsy" } },
{op: 'YB_PAGE_ENTER', name: '个人中心进入', equals: { PAGE_ID: 'wd' }},
{op: 'YB_CHOOSE_FOR_YOU', name: '个人中心猜你喜欢'},
{op: 'YB_SHOW_EVENT',},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1469', equals: { SUB_C_ID:'1469'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2073', equals: { SUB_C_ID:'2073'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1951', equals: { SUB_C_ID:'1951'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1', equals: { SUB_C_ID:'1'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1', equals: { SUB_C_ID:'1'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2', equals: { SUB_C_ID:'2'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2', equals: { SUB_C_ID:'2'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2', equals: { SUB_C_ID:'2'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光3', equals: { SUB_C_ID:'3'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1', equals: { CHANNEL_ID: '1', SUB_C_ID:'1'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel2', equals: { CHANNEL_ID: '2', SUB_C_ID:'2'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel3', equals: { CHANNEL_ID: '3', SUB_C_ID:'3'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel2073', equals: { CHANNEL_ID: '2073', SUB_C_ID:'2073'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1951', equals: { CHANNEL_ID: '1951', SUB_C_ID:'1951'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1469', equals: { CHANNEL_ID: '1469', SUB_C_ID:'1469'}},
{ op: 'YB_UFO', name: 'TAB BAR 点击UFO'},
{ op: 'YB_AUTO_TRACK', name: '自动点击TAB UFO上报'},
{ op: 'YB_PAGE_EXIT', name: "离开个人中心", equals: { PAGE_ID: "wd" } },
{op: 'YB_PAGE_ENTER', name: 'UFO进入', equals: { PAGE_ID: 'ufo' }},
{ op: 'UFO_BROWSE_HOME', name: 'UFO浏览'},
{ op: 'UFO_MAIN_START', name: 'UFO主页展示'},
]
};
\ No newline at end of file
... ...
... ... @@ -57,6 +57,9 @@ describe(ANDROID_ORDER_CONFIRM, '下单', async(driver) => {
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
//进入购物车
let goToShopCart = await driver.waitForElementById('com.yoho:id/activity_product_detail_sv', FIND_VIEW_OVER_TIME);
await goToShopCart.click();
// 去结算
let orderCreate = await driver.waitForElementById('com.yoho:id/common_shoppingcart_btn', FIND_VIEW_OVER_TIME);
await orderCreate.click();
... ... @@ -71,4 +74,11 @@ describe(ANDROID_ORDER_CONFIRM, '下单', async(driver) => {
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
// 支付
let orderPay = await driver.waitForElementById('com.yoho:id/pay_button', FIND_VIEW_OVER_TIME);
await orderPay.click();
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
});
... ...
... ... @@ -21,7 +21,7 @@ describe(ANDROID_PRODUCT_DETAIL, 'Android 商品详情进入用例', async(drive
//点击分类中的 其中一个品类
let category = await driver.waitForElementByXPath("/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup[1]/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.view.ViewGroup/android.support.v7.widget.RecyclerView/android.widget.LinearLayout[1]/android.widget.GridView/android.widget.RelativeLayout[1]/android.widget.ImageView", FIND_VIEW_OVER_TIME);
let category = await driver.waitForElementByXPath("/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup[1]/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.view.ViewGroup/android.support.v7.widget.RecyclerView/android.widget.LinearLayout[2]/android.widget.GridView/android.widget.RelativeLayout[1]", FIND_VIEW_OVER_TIME);
await category.click();
// 暂停
... ... @@ -56,9 +56,6 @@ describe(ANDROID_PRODUCT_DETAIL, 'Android 商品详情进入用例', async(drive
//点击加入购物车
let add = await driver.waitForElementById('com.yoho:id/btn_pro_info_submit', FIND_VIEW_OVER_TIME);
await add.click();
//进入购物车
let goToShopCart = await driver.waitForElementById('com.yoho:id/activity_product_detail_sv', FIND_VIEW_OVER_TIME);
await goToShopCart.click();
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
});
... ...
... ... @@ -31,18 +31,14 @@ describe(ANDROID_TAB_HOME,'安卓首页', async(driver) => {
touchTab = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup[1]/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.HorizontalScrollView/android.widget.LinearLayout/android.view.ViewGroup[5]',5000);
await touchTab.click();
//潮童
touchTab = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup[1]/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.HorizontalScrollView/android.widget.LinearLayout/android.view.ViewGroup[6]',5000);
await touchTab.click();
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
await (new wd.TouchAction(driver))
.press({x: 400, y: 248})
.moveTo({x: 585, y: 248})
.release()
.perform()
await (new wd.TouchAction(driver))
.press({x: 382, y: 271})
.moveTo({x: 640, y: 274})
.release()
.perform()
//返回男装
... ...
... ... @@ -37,6 +37,6 @@ describe(ANDROID_MAINTAB_SWITCH,'安卓首页TAB切换', async(driver) => {
await touchTab.click();
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
await driver.sleep(10000);
});
\ No newline at end of file
... ...