Authored by 李犇

订单、商品详情、首页、tab切换测试用例——review by 陈林

@@ -7,8 +7,14 @@ module.exports.iOS_TAB_CATEGORY = 'iOS_TAB_CATEGORY'; @@ -7,8 +7,14 @@ module.exports.iOS_TAB_CATEGORY = 'iOS_TAB_CATEGORY';
7 module.exports.iOS_TAB_GUANG = 'iOS_TAB_GUANG'; 7 module.exports.iOS_TAB_GUANG = 'iOS_TAB_GUANG';
8 module.exports.IOS_PRODUCT_DETAIL_GROUP = 'IOS_PRODUCT_DETAIL_GROUP'; 8 module.exports.IOS_PRODUCT_DETAIL_GROUP = 'IOS_PRODUCT_DETAIL_GROUP';
9 9
  10 +module.exports.ANDROID_TAB_HOME = 'ANDROID_TAB_HOME';
  11 +module.exports.ANDROID_TAB_CATEGORY = 'ANDROID_TAB_CATEGORY';
  12 +module.exports.ANDROID_TAB_GUANG = 'ANDROID_TAB_GUANG';
  13 +module.exports.ANDROID_CASE_UFO_BROWSE = 'ANDROID_CASE_UFO_BROWSE';
  14 +module.exports.ANDROID_TAB_MINE = 'ANDROID_TAB_MINE';
  15 +module.exports.ANDROID_MAINTAB_SWITCH = 'ANDROID_MAINTAB_SWITCH';
10 module.exports.ANDROID_PRODUCT_DETAIL = 'ANDROID_PRODUCT_DETAIL'; 16 module.exports.ANDROID_PRODUCT_DETAIL = 'ANDROID_PRODUCT_DETAIL';
11 module.exports.ANDROID_UFO_PRODUCT_DETAIL = 'ANDROID_UFO_PRODUCT_DETAIL'; 17 module.exports.ANDROID_UFO_PRODUCT_DETAIL = 'ANDROID_UFO_PRODUCT_DETAIL';
12 -module.exports.ANDROID_PRODUCT_CART = 'ANDROID_PRODUCT_CART';  
13 module.exports.ANDROID_CASE_UFO_BROWSE = 'ANDROID_CASE_UFO_BROWSE'; 18 module.exports.ANDROID_CASE_UFO_BROWSE = 'ANDROID_CASE_UFO_BROWSE';
14 module.exports.ANDROID_CASE_UFO_SELL = 'ANDROID_CASE_UFO_SELL'; 19 module.exports.ANDROID_CASE_UFO_SELL = 'ANDROID_CASE_UFO_SELL';
  20 +module.exports.ANDROID_ORDER_CONFIRM = 'ANDROID_ORDER_CONFIRM';
  1 +const {
  2 + ANDROID_ORDER_CONFIRM
  3 +} = require('../../scene-types/scene-types');
  4 +
  5 +module.exports = {
  6 + [ANDROID_ORDER_CONFIRM]: [
  7 +
  8 + { op: 'YB_PAGE_ENTER', name: '进入商品详情页', equals: { PAGE_ID: 'spxqy' } },
  9 + {
  10 + op: 'YB_GDS_DT_INFO', name: '请求商品数据成功', validate: (log) => {
  11 + return log.param.PRD_SKN.length > 0;
  12 + }
  13 + },
  14 + {
  15 + op: 'YB_GDS_COLOR_C', name: '点击颜色(可以没有 如果只有一个颜色是不可点击的)', validate: (log) => {
  16 + return log.param.PRD_ID.length > 0 && log.param.COLOR.length > 0;
  17 + }
  18 + },
  19 + {
  20 + op: 'YB_GDS_SIZE_C', name: '点击尺码(可以没有 如果只有一个尺码是不可点击的)', validate: (log) => {
  21 + return log.param.PRD_ID.length > 0 && log.param.SIZE.length > 0;
  22 + }
  23 + },
  24 + {
  25 + op: 'YB_GDS_DT_SEL', name: '加入购物车', validate: (log) => {
  26 + return log.param.PRD_SKU > 0;
  27 + }
  28 + },
  29 +
  30 + //套餐商品接口上报
  31 + {
  32 + op: 'YB_GDS_PACKAGE_L', name: '套餐商品接口上报', types: { LIST: Array }, validate: (log) => {
  33 + return log.param.PRD_ID.length > 0;
  34 + }
  35 + },
  36 + //售罄商品 推荐商品列表上报
  37 + {
  38 + op: 'YB_CHOOSE_FOR_YOU', name: '售罄商品 推荐商品列表上报', equals: { REC_POSE: '100025', ACTION_ID:'0'}, validate: (log) => {
  39 + return log.param.PRD_ID.length > 0 && log.param.MAIN_SKN.length > 0;
  40 + }
  41 + },
  42 + //点击售罄商品 推荐商品列表展开按钮
  43 + {
  44 + op: 'YB_GDS_DT_SHOW_RES_C', name: '点击售罄商品 推荐商品列表展开按钮', validate: (log) => {
  45 + return log.param.STATUS.length > 0 && log.param.MAIN_SKN.length > 0;
  46 + }
  47 + },
  48 + //店铺推荐的商品列表
  49 + {
  50 + op: 'YB_CHOOSE_FOR_YOU', name: '店铺推荐的商品列表', equals: { REC_POSE: '100029', ACTION_ID: '0' }, validate: (log) => {
  51 + return log.param.PRD_ID.length > 0;
  52 + }
  53 + },
  54 + //点击店铺推荐的商品列表
  55 + {
  56 + op: 'YB_CHOOSE_FOR_YOU', name: '点击店铺推荐的商品列表', equals: { REC_POSE: '100029', ACTION_ID: '1' }, validate: (log) => {
  57 + return log.param.PRD_ID.length > 0;
  58 + }
  59 + },
  60 +
  61 + //点击商品详情
  62 + {
  63 + op: 'YB_GDS_DT_BUY', name: '点击商品详情', validate: (log) => {
  64 + return log.param.PRD_ID.length > 0;
  65 + }
  66 + },
  67 + //点击在线客服
  68 + { op: 'YB_MY_OLCS', name: '点击在线客服', equals: { TYPE: '1' } },
  69 + //立即购买
  70 + {
  71 + op: 'YB_GDS_DT_BILL', name: '立即购买', validate: (log) => {
  72 + return log.param.PRD_SKN.length > 0 && log.param.PRD_SKU.length > 0 && log.param.PRD_TYPE.length > 0;
  73 + }
  74 + },
  75 + //点击提问问题按钮
  76 + { op: 'YB_GDS_DT_ASK', name: '点击提问问题按钮', types: { PRD_ID: String, TOURL: String } },
  77 + //点击店铺按钮
  78 + { op: 'YB_BRAND_SHOP_C', name:'点击店铺按钮', types:{SHOP_ID:String, POS_ID:String}},
  79 + //点击套餐
  80 + { op: 'YB_GDS_PACKAGE_C', name: '点击套餐', types: { PRD_ID: String } },
  81 + //点击分享
  82 + { op: 'YB_GDS_DT_SHARE', name: '点击分享', types: { PRD_ID: String, BR_ID: String, TOURL: String } },
  83 + //分享商品
  84 + { op: 'YB_SHARE_PRODUCT', name: '分享商品', equals: { FROM: 'pt' }, types: { PRD_ID: String, BR_ID: String, TOURL: String } },
  85 + ]
  86 +};
  87 +
  1 +const {
  2 + ANDROID_PRODUCT_DETAIL
  3 +} = require('../../scene-types/scene-types');
  4 +
  5 +module.exports = {
  6 + [ANDROID_PRODUCT_DETAIL]: [
  7 +
  8 + { op: 'YB_PAGE_ENTER', name: '进入商品详情页', equals: { PAGE_ID: 'spxqy' } },
  9 + {
  10 + op: 'YB_GDS_DT_INFO', name: '请求商品数据成功', validate: (log) => {
  11 + return log.param.PRD_SKN.length > 0;
  12 + }
  13 + },
  14 + {
  15 + op: 'YB_GDS_COLOR_C', name: '点击颜色(可以没有 如果只有一个颜色是不可点击的)', validate: (log) => {
  16 + return log.param.PRD_ID.length > 0 && log.param.COLOR.length > 0;
  17 + }
  18 + },
  19 + {
  20 + op: 'YB_GDS_SIZE_C', name: '点击尺码(可以没有 如果只有一个尺码是不可点击的)', validate: (log) => {
  21 + return log.param.PRD_ID.length > 0 && log.param.SIZE.length > 0;
  22 + }
  23 + },
  24 + {
  25 + op: 'YB_GDS_DT_SEL', name: '加入购物车', validate: (log) => {
  26 + return log.param.PRD_SKU > 0;
  27 + }
  28 + },
  29 +
  30 + //套餐商品接口上报
  31 + {
  32 + op: 'YB_GDS_PACKAGE_L', name: '套餐商品接口上报', types: { LIST: Array }, validate: (log) => {
  33 + return log.param.PRD_ID.length > 0;
  34 + }
  35 + },
  36 + //售罄商品 推荐商品列表上报
  37 + {
  38 + op: 'YB_CHOOSE_FOR_YOU', name: '售罄商品 推荐商品列表上报', equals: { REC_POSE: '100025', ACTION_ID:'0'}, validate: (log) => {
  39 + return log.param.PRD_ID.length > 0 && log.param.MAIN_SKN.length > 0;
  40 + }
  41 + },
  42 + //点击售罄商品 推荐商品列表展开按钮
  43 + {
  44 + op: 'YB_GDS_DT_SHOW_RES_C', name: '点击售罄商品 推荐商品列表展开按钮', validate: (log) => {
  45 + return log.param.STATUS.length > 0 && log.param.MAIN_SKN.length > 0;
  46 + }
  47 + },
  48 + //店铺推荐的商品列表
  49 + {
  50 + op: 'YB_CHOOSE_FOR_YOU', name: '店铺推荐的商品列表', equals: { REC_POSE: '100029', ACTION_ID: '0' }, validate: (log) => {
  51 + return log.param.PRD_ID.length > 0;
  52 + }
  53 + },
  54 + //点击店铺推荐的商品列表
  55 + {
  56 + op: 'YB_CHOOSE_FOR_YOU', name: '点击店铺推荐的商品列表', equals: { REC_POSE: '100029', ACTION_ID: '1' }, validate: (log) => {
  57 + return log.param.PRD_ID.length > 0;
  58 + }
  59 + },
  60 +
  61 + //点击商品详情
  62 + {
  63 + op: 'YB_GDS_DT_BUY', name: '点击商品详情', validate: (log) => {
  64 + return log.param.PRD_ID.length > 0;
  65 + }
  66 + },
  67 + //点击在线客服
  68 + { op: 'YB_MY_OLCS', name: '点击在线客服', equals: { TYPE: '1' } },
  69 + //立即购买
  70 + {
  71 + op: 'YB_GDS_DT_BILL', name: '立即购买', validate: (log) => {
  72 + return log.param.PRD_SKN.length > 0 && log.param.PRD_SKU.length > 0 && log.param.PRD_TYPE.length > 0;
  73 + }
  74 + },
  75 + //点击提问问题按钮
  76 + { op: 'YB_GDS_DT_ASK', name: '点击提问问题按钮', types: { PRD_ID: String, TOURL: String } },
  77 + //点击店铺按钮
  78 + { op: 'YB_BRAND_SHOP_C', name:'点击店铺按钮', types:{SHOP_ID:String, POS_ID:String}},
  79 + //点击套餐
  80 + { op: 'YB_GDS_PACKAGE_C', name: '点击套餐', types: { PRD_ID: String } },
  81 + //点击分享
  82 + { op: 'YB_GDS_DT_SHARE', name: '点击分享', types: { PRD_ID: String, BR_ID: String, TOURL: String } },
  83 + //分享商品
  84 + { op: 'YB_SHARE_PRODUCT', name: '分享商品', equals: { FROM: 'pt' }, types: { PRD_ID: String, BR_ID: String, TOURL: String } },
  85 + ]
  86 +};
  87 +
  1 +const {
  2 + ANDROID_TAB_HOME
  3 +} = require('../../scene-types/scene-types');
  4 +
  5 +module.exports = {
  6 + [ANDROID_TAB_HOME]:[
  7 + {op: 'YB_LAUNCH_APP', name: '启动app', single: true},
  8 + {op: 'YB_ENTER_CHOICE', name: '性别男女入口', single: true, validate: (log) => {
  9 + return ((log.param.ENT_TYP === '1' && log.param.SUB_C_ID === '1' && log.param.C_ID === '1')
  10 + || (log.param.ENT_TYP === '0' && log.param.SUB_C_ID === '2' && log.param.C_ID === '2'));
  11 + }},
  12 + {op: 'YB_MAIN_SHOW', name: '底部首页点击'},
  13 + {op: 'YB_PAGE_ENTER', name: '欢迎页载入', equals: { PAGE_ID: 'start' }},
  14 + {op: 'YB_PAGE_EXIT', name: '欢迎页载出', equals: { PAGE_ID: 'start' }},
  15 + {op: 'YB_PAGE_ENTER', name: '频道选择页载入', equals: { PAGE_ID: 'xbxzy' }},
  16 + {op: 'YB_PAGE_EXIT', name: '频道选择页载出', equals: { PAGE_ID: 'xbxzy' }},
  17 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  18 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  19 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  20 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  21 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  22 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  23 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  24 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  25 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  26 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  27 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  28 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  29 +
  30 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1469', types:{DATA: Array}, equals: { SUB_C_ID:'1469'}},
  31 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光2073', types:{DATA: Array}, equals: { SUB_C_ID:'2073'}},
  32 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1951', types:{DATA: Array}, equals: { SUB_C_ID:'1951'}},
  33 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1', types:{DATA: Array}, equals: { SUB_C_ID:'1'}},
  34 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光2', types:{DATA: Array}, equals: { SUB_C_ID:'2'}},
  35 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光3', types:{DATA: Array}, equals: { SUB_C_ID:'3'}},
  36 +
  37 + {op: 'YB_SHOW_EVENT',},
  38 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1469', equals: { SUB_C_ID:'1469'}},
  39 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2073', equals: { SUB_C_ID:'2073'}},
  40 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1951', equals: { SUB_C_ID:'1951'}},
  41 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1', equals: { SUB_C_ID:'1'}},
  42 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2', equals: { SUB_C_ID:'2'}},
  43 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光3', equals: { SUB_C_ID:'3'}},
  44 +
  45 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首次启动默认tab上报'},
  46 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1', equals: { CHANNEL_ID: '1', SUB_C_ID:'1'}},
  47 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel2', equals: { CHANNEL_ID: '2', SUB_C_ID:'2'}},
  48 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel3', equals: { CHANNEL_ID: '3', SUB_C_ID:'3'}},
  49 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel2073', equals: { CHANNEL_ID: '2073', SUB_C_ID:'2073'}},
  50 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1951', equals: { CHANNEL_ID: '1951', SUB_C_ID:'1951'}},
  51 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1469', equals: { CHANNEL_ID: '1469', SUB_C_ID:'1469'}},
  52 + ]
  53 +};
  1 +const {
  2 + ANDROID_MAINTAB_SWITCH
  3 +} = require('../../scene-types/scene-types');
  4 +
  5 +module.exports = {
  6 + [ANDROID_MAINTAB_SWITCH]:[
  7 + {op: 'YB_LAUNCH_APP', name: '启动app', single: true},
  8 + {op: 'YB_ENTER_CHOICE', name: '性别男女入口', single: true, validate: (log) => {
  9 + return ((log.param.ENT_TYP === '1' && log.param.SUB_C_ID === '1' && log.param.C_ID === '1')
  10 + || (log.param.ENT_TYP === '0' && log.param.SUB_C_ID === '2' && log.param.C_ID === '2'));
  11 + }},
  12 + {op: 'YB_MAIN_SHOW', name: '底部首页点击'},
  13 + {op: 'YB_PAGE_ENTER', name: '欢迎页载入', equals: { PAGE_ID: 'start' }},
  14 + {op: 'YB_PAGE_EXIT', name: '欢迎页载出', equals: { PAGE_ID: 'start' }},
  15 + {op: 'YB_PAGE_ENTER', name: '频道选择页载入', equals: { PAGE_ID: 'xbxzy' }},
  16 + {op: 'YB_PAGE_EXIT', name: '频道选择页载出', equals: { PAGE_ID: 'xbxzy' }},
  17 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  18 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  19 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  20 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  21 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  22 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  23 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  24 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  25 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  26 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  27 + {op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
  28 + {op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
  29 +
  30 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1469', types:{DATA: Array}, equals: { SUB_C_ID:'1469'}},
  31 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光2073', types:{DATA: Array}, equals: { SUB_C_ID:'2073'}},
  32 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1951', types:{DATA: Array}, equals: { SUB_C_ID:'1951'}},
  33 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光1', types:{DATA: Array}, equals: { SUB_C_ID:'1'}},
  34 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光2', types:{DATA: Array}, equals: { SUB_C_ID:'2'}},
  35 + {op: 'YB_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光3', types:{DATA: Array}, equals: { SUB_C_ID:'3'}},
  36 +
  37 + {op: 'YB_SHOW_EVENT',},
  38 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1469', equals: { SUB_C_ID:'1469'}},
  39 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2073', equals: { SUB_C_ID:'2073'}},
  40 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1951', equals: { SUB_C_ID:'1951'}},
  41 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光1', equals: { SUB_C_ID:'1'}},
  42 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光2', equals: { SUB_C_ID:'2'}},
  43 + {op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光3', equals: { SUB_C_ID:'3'}},
  44 +
  45 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首次启动默认tab上报'},
  46 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1', equals: { CHANNEL_ID: '1', SUB_C_ID:'1'}},
  47 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel2', equals: { CHANNEL_ID: '2', SUB_C_ID:'2'}},
  48 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel3', equals: { CHANNEL_ID: '3', SUB_C_ID:'3'}},
  49 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel2073', equals: { CHANNEL_ID: '2073', SUB_C_ID:'2073'}},
  50 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1951', equals: { CHANNEL_ID: '1951', SUB_C_ID:'1951'}},
  51 + {op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1469', equals: { CHANNEL_ID: '1469', SUB_C_ID:'1469'}},
  52 + ]
  53 +};
  1 +const wd = require('wd');
  2 +const {describe} = require('../../libs/driver');
  3 +const {ANDROID_ORDER_CONFIRM} = require('../../scene-types/scene-types');
  4 +const {FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME} = require('../../config/constant');
  5 +
  6 +describe(ANDROID_ORDER_CONFIRM, '下单', async(driver) => {
  7 +
  8 + //点击首页的tab bar 分类按钮
  9 + let categoryTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_sort_rl', FIND_VIEW_OVER_TIME);
  10 + await categoryTab.click();
  11 + //点击分类中的 其中一个分类
  12 + 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);
  13 + await category.click();
  14 +
  15 + // 暂停
  16 + await driver.sleep(ACTION_PAUSE_TIME);
  17 +
  18 + //点击其中的一个商品
  19 + let firstProduct = 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.RelativeLayout/android.widget.RelativeLayout/android.widget.ScrollView/android.widget.LinearLayout/android.support.v4.view.ViewPager/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.FrameLayout/android.support.v7.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.ImageView[1]");
  20 + await firstProduct.click();
  21 +
  22 + // 暂停
  23 + await driver.sleep(ACTION_PAUSE_TIME);
  24 +
  25 + //点击加入购物车(弹出尺码选择框)
  26 + let addToCart = await driver.waitForElementById('com.yoho:id/product_detail_add', FIND_VIEW_OVER_TIME);
  27 + await addToCart.click();
  28 +
  29 + //选择尺码
  30 + let chooseSize = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.view.ViewGroup/android.widget.LinearLayout[1]/android.widget.TextView', FIND_VIEW_OVER_TIME);
  31 + await chooseSize.click();
  32 +
  33 + // 暂停
  34 + await driver.sleep(ACTION_PAUSE_TIME);
  35 +
  36 + //点击加入购物车
  37 + let add = await driver.waitForElementById('com.yoho:id/btn_pro_info_submit', FIND_VIEW_OVER_TIME);
  38 + await add.click();
  39 +
  40 + //进入购物车
  41 + let goToShopCart = await driver.waitForElementById('com.yoho:id/activity_product_detail_sv', FIND_VIEW_OVER_TIME);
  42 + await goToShopCart.click();
  43 +
  44 + // 暂停
  45 + await driver.sleep(ACTION_PAUSE_TIME);
  46 +
  47 + // 去结算
  48 + let orderCreate = await driver.waitForElementById('com.yoho:id/common_shoppingcart_btn', FIND_VIEW_OVER_TIME);
  49 + await orderCreate.click();
  50 +
  51 + // 暂停
  52 + await driver.sleep(ACTION_PAUSE_TIME);
  53 +
  54 + // 确认结算
  55 + let orderConfirm = await driver.waitForElementById('com.yoho:id/make_sure_order', FIND_VIEW_OVER_TIME);
  56 + await orderConfirm.click();
  57 +
  58 + // 暂停
  59 + await driver.sleep(ACTION_PAUSE_TIME);
  60 +
  61 +});
  1 +const wd = require('wd');
  2 +const {describe} = require('../../libs/driver');
  3 +const {ANDROID_PRODUCT_DETAIL} = require('../../scene-types/scene-types');
  4 +const {FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME} = require('../../config/constant');
  5 +
  6 +describe(ANDROID_PRODUCT_DETAIL, 'Android 商品详情进入用例', async(driver) => {
  7 +
  8 + // 暂停
  9 + await driver.sleep(ACTION_PAUSE_TIME);
  10 +
  11 + //点击首页的tab bar 分类按钮
  12 + let categoryTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_sort_rl', 10000);
  13 + await categoryTab.click();
  14 +
  15 + // 暂停
  16 + await driver.sleep(ACTION_PAUSE_TIME);
  17 +
  18 + //点击分类中的第一个子分类:比如男装
  19 + let categorySubSortFirst = 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.LinearLayout/android.widget.LinearLayout[1]/android.widget.TextView", FIND_VIEW_OVER_TIME);
  20 + await categorySubSortFirst.click();
  21 +
  22 +
  23 + //点击分类中的 其中一个品类
  24 + 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);
  25 + await category.click();
  26 +
  27 + // 暂停
  28 + await driver.sleep(ACTION_PAUSE_TIME);
  29 + //点击其中的一个商品
  30 + let firstProduct = 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.RelativeLayout/android.widget.RelativeLayout/android.widget.ScrollView/android.widget.LinearLayout/android.support.v4.view.ViewPager/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.FrameLayout/android.support.v7.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.ImageView[1]");
  31 + await firstProduct.click();
  32 + // 暂停
  33 + await driver.sleep(ACTION_PAUSE_TIME);
  34 + //点击分享
  35 + let tapShare = await driver.waitForElementById('com.yoho:id/sharebtn', FIND_VIEW_OVER_TIME);
  36 + await tapShare.click();
  37 + //取消分享
  38 + let cancelShare = await driver.waitForElementById('com.yoho:id/share_cancle_lly', FIND_VIEW_OVER_TIME);
  39 + await cancelShare.click();
  40 + //点击加入购物车(弹出尺码选择框)
  41 + let addToCart = await driver.waitForElementById('com.yoho:id/product_detail_add', FIND_VIEW_OVER_TIME);
  42 + await addToCart.click();
  43 + //选择颜色
  44 + /*let chooseColor = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.view.ViewGroup/android.widget.LinearLayout/android.widget.TextView', FIND_VIEW_OVER_TIME);
  45 + await chooseColor.click();*/
  46 + //选择尺码
  47 + let chooseSize = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.view.ViewGroup/android.widget.LinearLayout[1]/android.widget.TextView', FIND_VIEW_OVER_TIME);
  48 + await chooseSize.click();
  49 + //加一下
  50 + let chooseAdd = await driver.waitForElementById('com.yoho:id/tv_pro_info_num_add', FIND_VIEW_OVER_TIME);
  51 + await chooseAdd.click();
  52 + //减一下
  53 + let chooseReduce = await driver.waitForElementById('com.yoho:id/tv_pro_info_num_sub', FIND_VIEW_OVER_TIME);
  54 + await chooseReduce.click();
  55 + //点击加入购物车
  56 + let add = await driver.waitForElementById('com.yoho:id/btn_pro_info_submit', FIND_VIEW_OVER_TIME);
  57 + await add.click();
  58 + //进入购物车
  59 + let goToShopCart = await driver.waitForElementById('com.yoho:id/activity_product_detail_sv', FIND_VIEW_OVER_TIME);
  60 + await goToShopCart.click();
  61 + // 暂停
  62 + await driver.sleep(ACTION_PAUSE_TIME);
  63 + //返回商品详情
  64 + let backPrdDetail = await driver.waitForElementById('com.yoho:id/back_imgbtn', FIND_VIEW_OVER_TIME);
  65 + await backPrdDetail.click();
  66 +});
  1 +const wd = require('wd');
  2 +const {describe} = require('../../libs/driver');
  3 +const {ANDROID_TAB_HOME} = require('../../scene-types/scene-types');
  4 +const {FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME} = require('../../config/constant');
  5 +
  6 +describe(ANDROID_TAB_HOME,'安卓首页', async(driver) => {
  7 + // 首页tab
  8 + let touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_home_rl',10000);
  9 + await touchTab.click();
  10 +
  11 + // 暂停
  12 + await driver.sleep(ACTION_PAUSE_TIME);
  13 +
  14 + //男装
  15 + 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[1]',5000);
  16 + await touchTab.click();
  17 +
  18 + //女装
  19 + 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[2]', 5000);
  20 + await touchTab.click();
  21 +
  22 + //球鞋
  23 + 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[3]',5000);
  24 + await touchTab.click();
  25 +
  26 + //生活方式
  27 + 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[4]',5000);
  28 + await touchTab.click();
  29 +
  30 + //高街BLK
  31 + 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);
  32 + await touchTab.click();
  33 +
  34 + //潮童
  35 + 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);
  36 + await touchTab.click();
  37 +
  38 + await new Promise(r => {
  39 + setTimeout(() => {
  40 + r()
  41 + }, 5000);
  42 + })
  43 +
  44 +
  45 +});
  1 +const wd = require('wd');
  2 +const {describe} = require('../../libs/driver');
  3 +const {ANDROID_MAINTAB_SWITCH} = require('../../scene-types/scene-types');
  4 +const {FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME} = require('../../config/constant');
  5 +
  6 +describe(ANDROID_MAINTAB_SWITCH,'安卓首页TAB切换', async(driver) => {
  7 + // 首页tab
  8 + let touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_home_rl',10000);
  9 + await touchTab.click();
  10 +
  11 + // 暂停
  12 + await driver.sleep(ACTION_PAUSE_TIME);
  13 +
  14 + // 分类tab
  15 + touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_sort_rl',10000);
  16 + await touchTab.click();
  17 +
  18 + // 暂停
  19 + await driver.sleep(ACTION_PAUSE_TIME);
  20 +
  21 + // 社区tab
  22 + touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_stroll_rl',10000);
  23 + await touchTab.click();
  24 +
  25 + // 暂停
  26 + await driver.sleep(ACTION_PAUSE_TIME);
  27 +
  28 + // 个人中心tab
  29 + touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_my_rl',10000);
  30 + await touchTab.click();
  31 +
  32 + // 暂停
  33 + await driver.sleep(ACTION_PAUSE_TIME);
  34 +
  35 + touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_ufo_rl',10000);
  36 + await touchTab.click();
  37 +
  38 + // 暂停
  39 + await driver.sleep(ACTION_PAUSE_TIME);
  40 +
  41 +});