Authored by 朱小军

优化场景

... ... @@ -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'}},
... ... @@ -49,6 +57,7 @@ module.exports = {
{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_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
... ...
... ... @@ -11,52 +11,76 @@ describe(IOS_PRODUCT_DETAIL, '商品详情页埋点测试', async(driver) => {
await category.click();
console.log("点击分类完成");
await driver.sleep(ACTION_PAUSE_TIME);
//点击其中的一个商品
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', 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', FIND_VIEW_OVER_TIME);
await backPrdDetail.click();
console.log("返回详情完成");
await driver.sleep(ACTION_PAUSE_TIME);
//点击分享
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('取消', FIND_VIEW_OVER_TIME);
await cancelShare.click();
console.log("取消完成");
await driver.sleep(ACTION_PAUSE_TIME);
let tapMore = await driver.waitForElementByAccessibilityId('moreActionBtn', FIND_VIEW_OVER_TIME);
await tapMore.click();
console.log("点击更多");
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('加入购物车', 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]', 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]', 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', 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', 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]', FIND_VIEW_OVER_TIME);
await add.click();
... ...
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,23 +47,21 @@ 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(4000);
// 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();
... ...