Authored by 李犇

Merge remote-tracking branch 'origin/develop' into develop

... ... @@ -11,21 +11,21 @@ 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;
}
},
// {
// 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;
// }
// },
// //套餐商品接口上报
// {
... ...
... ... @@ -3,5 +3,18 @@ const {
} = require('../../scene-types/scene-types');
module.exports = {
[iOS_TAB_MINE]:[]
[iOS_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_PAGE_ENTER', name: 'UFO载入'},
{op: 'YB_PAGE_ENTER', name: 'UFO载出'},
{op: 'YB_H5_PAGE_OPEN_', name: '新的好物url'},
]
};
\ No newline at end of file
... ...
const {describe} = require('../../libs/driver');
const {IOS_PRODUCT_DETAIL} = require('../../scene-types/scene-types');
const { FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME } = require('../../config/constant');
describe(IOS_PRODUCT_DETAIL, '商品详情页埋点测试', async(driver) => {
//点击首页的tab bar 分类按钮
... ... @@ -11,7 +12,7 @@ describe(IOS_PRODUCT_DETAIL, '商品详情页埋点测试', async(driver) => {
console.log("点击分类完成");
//点击其中的一个商品
let firstProduct = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[4]', 3000);
let firstProduct = await driver.waitForElementByAccessibilityId('yh_prd_cell_0_3', 3000);
await firstProduct.click();
console.log("点击其中一个商品完成");
//进入购物车
... ...
const wd = require('wd');
const { describe } = require('../../libs/driver');
const { IOS_PRODUCT_DETAIL_GROUP } = require('../../scene-types/scene-types');
const IOS_SLEEP_WAIT_TIME = 3000;
const { FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME } = require('../../config/constant');
describe(IOS_PRODUCT_DETAIL_GROUP, '拼团商品详情页埋点测试', async (driver) => {
//点击我的 tab
describe(IOS_PRODUCT_DETAIL_GROUP, '拼团商品详情页埋点测试(未登录)', async (driver) => {
console.log("点击TAB 我的");
let tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[5]', 10000);
tapView.click();
//暂停
await driver.sleep(IOS_SLEEP_WAIT_TIME);
// //模拟向上滚动
// driver.execute('mobile: scroll', { direction: 'down'});
// await new Promise(r => {
// setTimeout(() => {
// r()
// }, 2000);
// });
//点击5折拼团
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击5折 拼团");
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[16]', 3000);
tapView.click();
//暂停
await driver.sleep(IOS_SLEEP_WAIT_TIME);
//点击19元专区
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[3]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击返回");
tapView = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
tapView.click();
//暂停
await driver.sleep(IOS_SLEEP_WAIT_TIME);
//点击列表第一个
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther[1]', 3000);
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击首页TAB");
tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[1]', 10000);
tapView.click();
//暂停
await driver.sleep(IOS_SLEEP_WAIT_TIME);
// driver.execute('mobile: scroll', { direction: 'down' });
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击首页顶部搜索框");
tapView = await driver.waitForElementByAccessibilityId('homeSearch', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
console.log("输入指定的拼团SKN");
tapView = await driver.waitForElementByAccessibilityId('yh_search_vc_search', FIND_VIEW_OVER_TIME);
tapView.sendKeys("51905716");
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击搜索");
tapView = await driver.waitForElementByAccessibilityId('Search', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击指定的拼团商品");
tapView = await driver.waitForElementByAccessibilityId('yh_prd_cell_0_1', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击分享");
tapView = await driver.waitForElementByAccessibilityId('shareActionBtn', 3000);
await tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
console.log("取消分享");
tapView = await driver.waitForElementByAccessibilityId('取消', 3000);
await tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
console.log("点击更多");
tapView = await driver.waitForElementByAccessibilityId('moreActionBtn', 3000);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
console.log("回到首页");
tapView = await driver.waitForElementByAccessibilityId('yh_quick_jump_menu_1', 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 { FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME } = require('../../config/constant');
const {iOS_TAB_MINE} = require('../../scene-types/scene-types');
describe(iOS_TAB_MINE,'我的', async(driver) => {
let touchTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[5]',6000);
let 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();
touchTab = await driver.waitForElementByXPath('/XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[7]/XCUIElementTypeOther/XCUIElementTypeOther[1]',2000);
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByXPath('/XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[7]/XCUIElementTypeOther/XCUIElementTypeOther[1]',FIND_VIEW_OVER_TIME);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', 2000);
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
await touchTab.click();
touchTab = await driver.waitForElementByXPath('/XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[7]/XCUIElementTypeOther/XCUIElementTypeOther[2]',2000);
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByXPath('/XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[7]/XCUIElementTypeOther/XCUIElementTypeOther[2]',FIND_VIEW_OVER_TIME);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('我的收入', 2000);
touchTab = await driver.waitForElementByAccessibilityId('我的收入', FIND_VIEW_OVER_TIME);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', 2000);
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('商家入驻', 2000);
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('商家入驻', FIND_VIEW_OVER_TIME);
await touchTab.click();
await driver.sleep(ACTION_PAUSE_TIME);
let element = await driver.elementsByAccessibilityId("完善信息");
if (await element.isDisplayed()){
// let isDisplayed = await element.isDisplayed();
// if (isDisplayed){
touchTab = await driver.waitForElementByAccessibilityId('完善信息');
await touchTab.click();
}
// }
await driver.sleep(ACTION_PAUSE_TIME);
touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', 2000);
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('yh_base_vc_back_btn', 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);
});
\ No newline at end of file
... ...