Authored by 朱小军

首页埋点检测

module.exports.iOS_TAB_HOME = 'iOS_TAB_HOME';
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';
... ...
const {
iOS_TAB_HOME
} = require('../../scene-types/scene-types');
module.exports = {
[iOS_TAB_HOME]:[
{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 === '2' && log.param.SUB_C_ID === '2' && log.param.C_ID === '2'));
}},
{op: 'YB_MAIN_SHOW', name: 'tabbar首页点击'},
{op: 'YB_PAGE_ENTER', name: '首页载入', equals: { PAGE_ID: 'sy' }},
{op: 'YB_PAGE_EXIT', 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'}},
{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_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_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_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_channel3', equals: { CHANNEL_ID: '3', SUB_C_ID:'3'}},
{op: 'YB_MAIN_LT_CHS'},//侧边栏
//TODO:默认
// {op: 'YB_MY_MESS'},//消息中心
// {op: 'YB_MAIN_S'},//搜索
// {op: 'YB_MAIN_RT'},//扫描
// {op: 'YB_SHOW_MAIN', name: '首页楼层接口曝光'}, //开启自动曝光没有这个事件
]
};
\ No newline at end of file
... ...
const wd = require('wd');
const {describe} = require('../../libs/driver');
const {iOS_TAB_HOME} = require('../../scene-types/scene-types');
describe(iOS_TAB_HOME,'首页测试', async(driver) => {
let touchTab = await driver.waitForElementByAccessibilityId('home drawer entrance',10000);
await touchTab.click();
await new Promise(r => {
setTimeout(() => {
r()
}, 2000);
})
await (new wd.TouchAction(driver))
.press({x: 300, y: 158})
.moveTo({x: 191, y: 162})
.release()
.perform()
// let action = new wd.TouchAction();
// action.press({x: 300, y: 10});
// await action.perform();
touchTab = await driver.waitForElementByAccessibilityId('homeSearch',5000);
await touchTab.click();
// touchTab = await driver.waitForElementByAccessibilityId('home message center',10000);
// await touchTab.click();
// touchTab = await driver.waitForElementByAccessibilityId('qr home',10000);
// await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('球鞋',5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('女装',5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('生活方式',5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('潮童',5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('高街BLK',1000);
await touchTab.click();
touchTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[1]',5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('男装',5000);
await touchTab.click();
await new Promise(r => {
setTimeout(() => {
r()
}, 5000);
})
});
\ No newline at end of file
... ...