Authored by 陈林

删除了UFO 商品详情测试demo。

const {
ANDROID_UFO_PRODUCT_DETAIL
} = require('../../scene-types/scene-types');
module.exports = {
[ANDROID_UFO_PRODUCT_DETAIL]: [
{op: 'YB_LAUNCH_APP', name: '启动app', single: true},
{op: 'YB_PAGE_ENTER', name: '第一次打开页面', equals: { PAGE_ID: 'sy' }},
{op: 'YB_PAGE_ENTER', name: '第一次打开页面2'},
{op: 'YB_PAGE_ENTER'},
{op: 'YB_ENTER_CHOICE'},
{op: 'YB_PAGE_EXIT', equals: { PAGE_ID: 'xbxzy' }},
{op: 'YB_PAGE_EXIT'},
{op: 'YB_CATEGORY'},
{op: 'YB_AUTO_TRACK'},
{op: 'YB_PAGE_EXIT', priority: 11},
{op: 'YB_PAGE_ENTER'},
{op: 'YB_CHOOSE_FOR_YOU'},
{op: 'YB_AUTO_TRACK'},
{op: 'YB_GOODS_LIST'},
{op: 'YB_SHOW_GOODS_LIST'},
{op: 'YB_PAGE_EXIT'},
{op: 'YB_PAGE_ENTER'},
{op: 'YB_GOODS_LIST_DT'},
{op: 'YB_AUTO_TRACK'},
{op: 'YB_GDS_DT_INFO'},
{op: 'YB_PAGE_ENTER'},
{op: 'YB_PAGE_EXIT', validate: (log) => {
return log.param.PAGE_ID === 'pl';
}},
{op: 'YB_CHOOSE_FOR_YOU'}
]
};
const {
IOS_UFO_PRODUCT_DETAIL
} = require('../../scene-types/scene-types');
module.exports = {
[IOS_UFO_PRODUCT_DETAIL]: [
{op: 'YB_LAUNCH_APP', name: '启动app', single: true},
{op: 'YB_PAGE_ENTER', name: '第一次打开页面', equals: { PAGE_ID: 'sy' }},
{op: 'YB_PAGE_ENTER', name: '第一次打开页面2'},
{op: 'YB_PAGE_ENTER'},
{op: 'YB_SHOW_CATEGORY', name: 'YB_SHOW_CATEGORY1', types: {YH_AppChannelBlk: Array, 'YH_AppChannelBlk[0].SUBLIST': Array}},
{op: 'YB_SHOW_CATEGORY', name: 'YB_SHOW_CATEGORY2'},
{op: 'YB_ENTER_CHOICE'},
{op: 'YB_SHOW_CATEGORY', name: 'YB_SHOW_CATEGORY3'},
{op: 'YB_PAGE_EXIT', equals: { PAGE_ID: 'xbxzy' }},
{op: 'YB_PAGE_EXIT'},
{op: 'YB_CATEGORY'},
{op: 'YB_AUTO_TRACK'},
{op: 'YB_PAGE_EXIT', priority: 11},
{op: 'YB_CATEGORY_CLS_TAB', priority: 13},
{op: 'YB_PAGE_ENTER'},
{op: 'YB_SHOW_MAIN_RECOMMEND'},
{op: 'YB_CHOOSE_FOR_YOU'},
{op: 'YB_CATEGORY_CAT_FLR_C', priority: 12},
{op: 'YB_AUTO_TRACK'},
{op: 'YB_GOODS_LIST'},
{op: 'YB_SHOW_GOODS_LIST'},
{op: 'YB_PAGE_EXIT'},
{op: 'YB_PAGE_ENTER'},
{op: 'YB_GOODS_LIST_DT'},
{op: 'YB_AUTO_TRACK'},
{op: 'YB_GDS_DT_INFO'},
{op: 'YB_PAGE_ENTER'},
{op: 'YB_PAGE_EXIT', validate: (log) => {
return log.param.PAGE_ID === 'pl';
}},
{op: 'YB_CHOOSE_FOR_YOU'}
]
};
const {describe} = require('../../libs/driver');
const {ANDROID_UFO_PRODUCT_DETAIL} = require('../../scene-types/scene-types');
describe(ANDROID_UFO_PRODUCT_DETAIL, '商品详情页埋点测试2', async(driver) => {
let categoryTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_sort', 10000);
await categoryTab.click();
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]', 10000);
await category.click();
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', 10000);
await firstProduct.click();
let addToCart = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.TextView', 10000);
await addToCart.click();
});
const {describe} = require('../../libs/driver');
const {IOS_UFO_PRODUCT_DETAIL} = require('../../scene-types/scene-types');
describe(IOS_UFO_PRODUCT_DETAIL, '商品详情页埋点测试2', async(driver) => {
let categoryTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTabBar/XCUIElementTypeButton[2]', 10000);
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/XCUIElementTypeOther[1]/XCUIElementTypeOther[3]/XCUIElementTypeCollectionView/XCUIElementTypeCell[1]/XCUIElementTypeOther', 10000);
await category.click();
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/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[1]/XCUIElementTypeOther/XCUIElementTypeOther', 10000);
await firstProduct.click();
let addToCart = await driver.waitForElementByXPath('//XCUIElementTypeButton[@name="加入购物车"]', 10000);
await addToCart.click();
});