Authored by 孟顺

Merge branch 'master' into develop

... ... @@ -4,7 +4,6 @@ module.exports.IOS_PRODUCT_DETAIL = 'IOS_PRODUCT_DETAIL';
module.exports.IOS_UFO_PRODUCT_DETAIL = 'IOS_UFO_PRODUCT_DETAIL';
module.exports.IOS_PRODUCT_CART = 'IOS_PRODUCT_CART';
module.exports.iOS_TAB_CATEGORY = 'iOS_TAB_CATEGORY';
// module.exports.iOS_TAB_GUANG = 'iOS_TAB_GUANG';
module.exports.IOS_PRODUCT_DETAIL_GROUP = 'IOS_PRODUCT_DETAIL_GROUP';
module.exports.iOS_TAB_UFOHOME = "iOS_TAB_UFOHOME";
module.exports.iOS_TAB_MINE = 'iOS_TAB_MINE';
... ...
... ... @@ -10,12 +10,37 @@ module.exports = {
{ op: 'YB_PAGE_ENTER', name: "进入品类", equals: { PAGE_ID: "pl" } },
{ op: 'YB_SHOW_EVENT', name: "曝光事件", types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_SHOW_CATEGORY', name: '展示品类列表', types: { DATA: Array } },
{ op: 'YB_PAGE_ENTER', name: '进入品类商品列表页', equals: { PAGE_ID: 'plsplb' } },
{
op: 'YB_GDS_LIST', name: '品类列表页', validate: (log) => {
return log.param.ENT_ID.length > 0 && log.param.ENT_TYP == 4;
}
},
// { op: 'YB_PAGE_ENTER', name: '进入品类商品列表页', equals: { PAGE_ID: 'plsplb' } },
{ op: 'YB_SHOW_BRANDLIST', name: '品牌列表曝光'},
{ op: 'YB_CATEGORY_BRAND_LIST_CH', name: '主界面-分类-品牌-频道选择'},
{ op: 'YB_CATEGORY_BRAND_LIST_SG', name: '切换品牌tab'},
// { op: 'YB_GDS_LIST', name: '品牌商品列表'},
{ op: 'YB_CATEGORY_BRAND_LIST_CH', name: '主界面-分类-品牌-频道选择'},
{ op: 'YB_CATEGORY_BRAND_LIST_CH', name: '主界面-分类-品牌-频道选择'},
{ op: 'YB_CATEGORY_BRAND_LIST_CH', name: '主界面-分类-品牌-频道选择'},
{ op: 'YB_CATEGORY_BRAND_LIST_SG', name: '切换品牌tab'},
{ op: 'YB_CATEGORY_BRAND_LIST_SG', name: '切换品牌tab'},
{ op: 'YB_CATEGORY_BRAND_LIST_SG', name: '切换品牌tab'},
{ op: 'YB_SHOW_BRANDBANNER', name: '品牌banner曝光1'},
{ op: 'YB_SHOW_BRANDBANNER', name: '品牌banner曝光2'},
{ op: 'YB_CATEGORY_CLS_TAB', name: '品类'},
{ op: 'YB_CATEGORY_BRAND_TAB', name: '品牌'},
{ op: 'YB_CATEGORY_CAT_FLR_C', name: '右侧分类类目'},
// {
// op: 'YB_GDS_LIST', name: '品类列表页', validate: (log) => {
// return log.param.ENT_ID.length > 0 && log.param.ENT_TYP == 4;
// }
// },
]
};
\ No newline at end of file
... ...
const {
iOS_TAB_GUANG
} = require('../../scene-types/scene-types');
module.exports = {
[iOS_TAB_GUANG]:[
{ op: 'YB_STROLL', name: 'TAB BAR 点击品类'},
{ op: 'YB_PAGE_EXIT', name: "离开首页", equals: { PAGE_ID: "sy" } },
{ op: 'YB_PAGE_ENTER', name: "进入品类", equals: { PAGE_ID: "guangsy" } },
{ op: 'YB_SHOW_EVENT', name: "曝光事件", types: { DATA: Array } },
{ op: 'YB_STROLL_MAIN_TAB_C', name: '点击顶部的TAB按钮'},
]
};
\ No newline at end of file
... ... @@ -26,6 +26,9 @@ module.exports = {
{op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
{op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
{op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
{op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
{op: 'YB_PAGE_EXIT', name: '首页载出', equals: { PAGE_ID: 'sy' }},
{op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
{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'}},
... ... @@ -33,14 +36,19 @@ module.exports = {
{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_SHOW_MAIN_RECOMMEND', name: '首页猜你喜欢接口曝光有食', types:{DATA: Array}, equals: { SUB_C_ID:'2077'}},
{op: 'YB_SHOW_MAIN_RECOMMEND', name: '默认的首页猜你喜欢接口曝光'},
{op: 'YB_SHOW_EVENT',},
{op: 'YB_SHOW_EVENT'},
{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: '首页猜你喜欢接口曝光2', equals: { SUB_C_ID:'2'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光3', equals: { SUB_C_ID:'3'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '首页猜你喜欢接口曝光有食', equals: { SUB_C_ID:'2077'}},
{op: 'YB_CHOOSE_FOR_YOU', name: '默认的首页猜你喜欢接口曝光'},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首次启动默认tab上报'},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1', equals: { CHANNEL_ID: '1', SUB_C_ID:'1'}},
... ... @@ -48,7 +56,8 @@ module.exports = {
{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_HOME_CHANNEL_TAB_C', name: '首页内tab_channel1469', equals: { CHANNEL_ID: '1469', SUB_C_ID:'1469'}},
{op: 'YB_HOME_CHANNEL_TAB_C', name: '首页内tab_channel有食', equals: { CHANNEL_ID: '2077', SUB_C_ID:'2077'}},
{op: 'YB_MAIN_LT_CHS'},//侧边栏
{op: 'YB_AUTO_TRACK', name: '侧边栏点击',validate: (log) => {
... ...
... ... @@ -6,7 +6,7 @@ module.exports = {
[iOS_TAB_MINE]:[
{op: 'UFO_MY_ITEM_C', name: '我的收入'},
// {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: '商家入驻载入'},
... ...
... ... @@ -65,4 +65,51 @@ describe(iOS_BUSINESS_SHOPPING,'购物车', async(driver) => {
// await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[5]',FIND_VIEW_OVER_TIME);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('mine_order_payment_new', FIND_VIEW_OVER_TIME);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
// touchTab = await driver.waitForElementByAccessibilityId('立即付款', FIND_VIEW_OVER_TIME);
// await touchTab.click();
// await driver.sleep(ACTION_PAUSE_TIME);
// touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
// await touchTab.click();
// await driver.sleep(ACTION_PAUSE_TIME);
// touchTab = await driver.waitForElementByAccessibilityId('确认离开', FIND_VIEW_OVER_TIME);
// await touchTab.click();
// await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('取消订单', FIND_VIEW_OVER_TIME);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('确定', FIND_VIEW_OVER_TIME);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
console.log('完成事件');
touchTab = await driver.waitForElementByAccessibilityId('完成', FIND_VIEW_OVER_TIME);
await driver.sleep(ACTION_PAUSE_TIME);
action = new wd.TouchAction(driver);
action.longPress({x: 100, y: 150})
.moveTo({x: 100, y: 250})
.release();
await action.perform();
});
\ No newline at end of file
... ...
... ... @@ -4,70 +4,94 @@ const { FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME } = require('../../config/constan
describe(IOS_PRODUCT_DETAIL, '商品详情页埋点测试', async(driver) => {
//点击首页的tab bar 分类按钮
let categoryTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[2]', 10000);
let categoryTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[2]', FIND_VIEW_OVER_TIME);
await categoryTab.click();
//点击分类中的 其中一个分类
let category = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[3]/XCUIElementTypeCollectionView/XCUIElementTypeCell[4]/XCUIElementTypeOther', 3000);
let category = await driver.waitForElementByAccessibilityId('yh_categoryCell_0', FIND_VIEW_OVER_TIME);
await category.click();
console.log("点击分类完成");
await driver.sleep(ACTION_PAUSE_TIME);
//点击其中的一个商品
let firstProduct = await driver.waitForElementByAccessibilityId('yh_prd_cell_0_3', 3000);
let firstProduct = await driver.waitForElementByAccessibilityId('yh_prd_cell_0_3', FIND_VIEW_OVER_TIME);
await firstProduct.click();
console.log("点击其中一个商品完成");
await driver.sleep(ACTION_PAUSE_TIME);
//进入购物车
let goToShopCart = await driver.waitForElementByAccessibilityId('yh_prd_detail_shopcart_btn', 3000);
let goToShopCart = await driver.waitForElementByAccessibilityId('yh_prd_detail_shopcart_btn', FIND_VIEW_OVER_TIME);
await goToShopCart.click();
console.log("进入购物车完成");
await driver.sleep(ACTION_PAUSE_TIME);
//返回商品详情
let backPrdDetail = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', 3000);
let backPrdDetail = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
await backPrdDetail.click();
console.log("返回详情完成");
await driver.sleep(ACTION_PAUSE_TIME);
//点击分享
let tapShare = await driver.waitForElementByAccessibilityId('shareActionBtn', 3000);
let tapShare = await driver.waitForElementByAccessibilityId('shareActionBtn', FIND_VIEW_OVER_TIME);
await tapShare.click();
console.log("点击分享完成");
await driver.sleep(ACTION_PAUSE_TIME);
//取消分享
let cancelShare = await driver.waitForElementByAccessibilityId('取消', 3000);
let cancelShare = await driver.waitForElementByAccessibilityId('取消', FIND_VIEW_OVER_TIME);
await cancelShare.click();
console.log("取消完成");
let tapMore = await driver.waitForElementByAccessibilityId('moreActionBtn', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
let tapMore = await driver.waitForElementByAccessibilityId('moreActionBtn', FIND_VIEW_OVER_TIME);
await tapMore.click();
console.log("点击更多");
let cancelMore = await driver.waitForElementByAccessibilityId('quick_jump_bg_view', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
let cancelMore = await driver.waitForElementByAccessibilityId('quick_jump_bg_view', FIND_VIEW_OVER_TIME);
await cancelMore.click();
console.log("取消更多");
await driver.sleep(ACTION_PAUSE_TIME);
//点击加入购物车
let addToCart = await driver.waitForElementByAccessibilityId('加入购物车', 3000);
let addToCart = await driver.waitForElementByAccessibilityId('加入购物车', FIND_VIEW_OVER_TIME);
await addToCart.click();
console.log("点击选择颜色尺码弹窗完成");
await driver.sleep(ACTION_PAUSE_TIME);
//选择颜色
let chooseColor = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[1]/XCUIElementTypeStaticText[1]', 3000);
let chooseColor = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[1]/XCUIElementTypeStaticText[1]', FIND_VIEW_OVER_TIME);
await chooseColor.click();
console.log("完成选择颜色");
await driver.sleep(ACTION_PAUSE_TIME);
//选择尺码
let chooseSize = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[2]/XCUIElementTypeStaticText[1]', 3000);
let chooseSize = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[2]/XCUIElementTypeStaticText[1]', FIND_VIEW_OVER_TIME);
await chooseSize.click();
console.log("完成选择尺码");
await driver.sleep(ACTION_PAUSE_TIME);
//加一下
let chooseAdd = await driver.waitForElementByAccessibilityId('yh_choose_view_add_btn', 3000);
let chooseAdd = await driver.waitForElementByAccessibilityId('yh_choose_view_add_btn', FIND_VIEW_OVER_TIME);
await chooseAdd.click();
console.log("点击加一件");
await driver.sleep(ACTION_PAUSE_TIME);
//减一下
let chooseReduce = await driver.waitForElementByAccessibilityId('yh_choose_view_reduce_btn', 3000);
let chooseReduce = await driver.waitForElementByAccessibilityId('yh_choose_view_reduce_btn', FIND_VIEW_OVER_TIME);
await chooseReduce.click();
console.log("点击减一件");
await driver.sleep(ACTION_PAUSE_TIME);
//点击加入购物车
let add = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeButton[2]', 3000);
let add = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeButton[2]', FIND_VIEW_OVER_TIME);
await add.click();
console.log("点加购物车");
await driver.sleep(3000);
await driver.sleep(4000);
console.log("点击返回列表");
let backBtn = await driver.waitForElementByAccessibilityId('backActionBtn', 3000);
let backBtn = await driver.waitForElementByAccessibilityId('backActionBtn', FIND_VIEW_OVER_TIME);
await backBtn.click();
await driver.sleep(3000);
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击返回品类页");
backBtn = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', 3000);
backBtn = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
await backBtn.click();
await driver.sleep(3000);
await driver.sleep(ACTION_PAUSE_TIME);
});
\ No newline at end of file
... ...
... ... @@ -5,38 +5,71 @@ const { FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME } = require('../../config/constan
describe(iOS_TAB_CATEGORY,'分类(品类&品牌)', async(driver) => {
//点击首页的tab bar 分类按钮
let tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[2]', 10000);
let tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[2]', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择左侧的分类点击 第二个
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTable/XCUIElementTypeCell[2]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('YH_LeftCategoryView_1', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择左侧的分类点击 第三个
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTable/XCUIElementTypeCell[3]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('YH_LeftCategoryView_2', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择左侧的分类点击 第四个
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTable/XCUIElementTypeCell[4]', 3000);
await tapView.click();
//选择 女装点击
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView/XCUIElementTypeCell[2]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('YH_LeftCategoryView_3', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 生活方式点击
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView/XCUIElementTypeCell[3]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_2', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 女装点击
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_1', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 潮童点击
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView/XCUIElementTypeCell[4]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_3', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 高街BLK点击
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView/XCUIElementTypeCell[5]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_4', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 男装点击
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView/XCUIElementTypeCell[1]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_0', FIND_VIEW_OVER_TIME);
await tapView.click();
//点击分类中的 其中一个分类
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[3]/XCUIElementTypeCollectionView/XCUIElementTypeCell[4]/XCUIElementTypeOther', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_categoryCell_1', FIND_VIEW_OVER_TIME);
await tapView.click();
console.log("回到品类首页");
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
tapView.click();
console.log("点击品牌");
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_brand_nav_btn', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_2', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_4', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_3', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_1', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_0', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_category_nav_btn', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
});
\ No newline at end of file
... ...
const wd = require('wd');
const {describe} = require('../../libs/driver');
const {iOS_TAB_GUANG} = require('../../scene-types/scene-types');
// const wd = require('wd');
// const {describe} = require('../../libs/driver');
// const {iOS_TAB_GUANG} = require('../../scene-types/scene-types');
describe(iOS_TAB_GUANG,'逛(有货社区)', async(driver) => {
//点击首页的tab bar 社区按钮
let tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[4]', 10000);
await tapView.click();
// describe(iOS_TAB_GUANG,'逛(有货社区)', async(driver) => {
// //点击首页的tab bar 社区按钮
// let tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[4]', 10000);
// await tapView.click();
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[3]', 3000);
await tapView.click();
// tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[3]', 3000);
// await tapView.click();
await new Promise(r => {
setTimeout(() => {
r();
}, 3000);
});
});
\ No newline at end of file
// await new Promise(r => {
// setTimeout(() => {
// r();
// }, 3000);
// });
// });
\ No newline at end of file
... ...
const wd = require('wd');
const {describe} = require('../../libs/driver');
const {iOS_TAB_HOME} = require('../../scene-types/scene-types');
const { FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME } = require('../../config/constant');
describe(iOS_TAB_HOME,'首页', async(driver) => {
let touchTab = await driver.waitForElementByAccessibilityId('home drawer entrance',10000);
... ... @@ -11,7 +12,7 @@ describe(iOS_TAB_HOME,'首页', async(driver) => {
}, 2000);
})
await (new wd.TouchAction(driver))
.press({x: 300, y: 158})
.longPress({x: 300, y: 158})
.moveTo({x: 290, y: 162})
.release()
.perform()
... ... @@ -28,21 +29,38 @@ describe(iOS_TAB_HOME,'首页', async(driver) => {
touchTab = await driver.waitForElementByAccessibilityId('球鞋',5000);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('男装', 5000);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('女装',5000);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('生活方式',5000);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('高街BLK', 1000);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('潮童',5000);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('有食',5000);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[1]',5000);
await touchTab.click();
... ...
... ... @@ -37,7 +37,7 @@ describe(iOS_TAB_MINE,'我的', async(driver) => {
// await touchTab.click();
// await driver.sleep(ACTION_PAUSE_TIME);
// s
//
// let element = await driver.elementsByAccessibilityId("完善信息");
// let isDisplayed = await element.isDisplayed();
// if (isDisplayed){
... ... @@ -47,27 +47,25 @@ describe(iOS_TAB_MINE,'我的', async(driver) => {
// await driver.sleep(ACTION_PAUSE_TIME);
// touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
// touchTab = await driver.waitForElementByAccessibilityId('新的好物 没有你的好物?申请上架', FIND_VIEW_OVER_TIME);
// await touchTab.click();
// await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('新的好物 没有你的好物?申请上架', FIND_VIEW_OVER_TIME);
await touchTab.click();
// await driver.sleep(4000);
await driver.sleep(ACTION_PAUSE_TIME);
// console.log("新的好物退出");
// let action = new wd.TouchAction(driver);
// action.press({x: 10, y: 10})
// .moveTo({x: 50, y: 10})
// .release();
// await action.perform();
let action = new wd.TouchAction(driver);
action.press({x: 10, y: 10})
.moveTo({x: 50, y: 50})
.release();
await action.perform();
// await driver.sleep(ACTION_PAUSE_TIME);
await driver.sleep(ACTION_PAUSE_TIME);
// console.log("退出球鞋交易");
touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
});
\ No newline at end of file
... ...
... ... @@ -20,8 +20,8 @@ describe(iOS_TAB_UFOHOME, "球鞋市集", async (driver) => {
tapView = await driver.waitForElementByAccessibilityId('yh_search_vc_search', FIND_VIEW_OVER_TIME);
tapView.sendKeys('ufo');
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击UFO");
tapView = await driver.waitForElementByXPath('//XCUIElementTypeStaticText[@name="ufo"]', FIND_VIEW_OVER_TIME);
console.log("点击搜索");
tapView = await driver.waitForElementByAccessibilityId('Search', FIND_VIEW_OVER_TIME);
tapView.click();
// await driver.sleep(ACTION_PAUSE_TIME);
// console.log("点击UFO店铺");
... ... @@ -39,11 +39,11 @@ describe(iOS_TAB_UFOHOME, "球鞋市集", async (driver) => {
console.log("点击收藏");
tapView = await driver.waitForElementByAccessibilityId('yh_ufo_prd_detail_collect_btn', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
await driver.sleep(4000); //弹窗时间过长 需要等待弹窗消失
console.log("取消收藏");
tapView = await driver.waitForElementByAccessibilityId('yh_ufo_prd_detail_collect_btn', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
await driver.sleep(4000);
console.log("点返回搜索页");
tapView = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
tapView.click();
... ...