Authored by 朱小军

更新个人中心脚本

... ... @@ -5,6 +5,7 @@ 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_TAB_MINE = 'iOS_TAB_MINE';
module.exports.ANDROID_PRODUCT_DETAIL = 'ANDROID_PRODUCT_DETAIL';
module.exports.ANDROID_UFO_PRODUCT_DETAIL = 'ANDROID_UFO_PRODUCT_DETAIL';
... ...
... ... @@ -6,11 +6,15 @@ module.exports = {
[iOS_BUSINESS_SHOPPING]:[
{ op: 'YB_SHOW_GLOBAL_SHOPCART', name: '全球购购物车', types: {GOODS_LIST: Array, SOLD_OUT_GOODS_LIST: Array}},
{ op: 'YB_CHOOSE_FOR_YOU', name: "看了此商品的人还买了", equals: { CART_TYPE: "1", REC_POSE: '100041'}},
{ op: 'YB_CHOOSE_FOR_YOU', name: "*[预售]看了此商品的人还买了", equals: { CART_TYPE: "2", REC_POSE: '100041' }},
//预售商品
// { op: 'YB_CHOOSE_FOR_YOU', name: "*[预售]看了此商品的人还买了", equals: { CART_TYPE: "2", REC_POSE: '100041' }},
{ op: 'YB_CHOOSE_FOR_YOU', name: "购物车猜你喜欢", equals: { REC_POSE: '100003'}},
{ op: 'YB_SC_MOD_ADD', name: "增加商品数量"},
{ op: 'YB_SC_MOD_SUB', name: "减少商品数量"},
{ op: 'YB_SC_EDIT', name: "编辑"},
// { op: 'YB_GDS_DT_SEL', name: "购物车内直接购买"},
{ op: 'YB_SHOW_EVENT', name: "商品列表曝光"},
{ op: 'YB_SC_TOPAY', name:'购物车结算'},
{ op: 'YB_SC_ORD', name:'购物车提交订单成功'},
]
};
\ No newline at end of file
... ...
... ... @@ -7,15 +7,13 @@ describe(iOS_BUSINESS_SHOPPING,'购物车', async(driver) => {
let touchTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[4]',5000);
await touchTab.click();
// driver.execute('mobile: scroll', {direction: 'down', element: element.value.'BF000000-0000-0000-922D-000000000000'});
// await driver.sleep(3000);
touchTab = await driver.waitForElementByAccessibilityId('select',3000);//单选
await touchTab.click();
// touchTab = await driver.waitForElementByAccessibilityId('selectAll',3000);//全选
// await touchTab.click();
// touchTab = await driver.waitForElementByAccessibilityId('mealSelect',3000);//套餐
// await touchTab.click();
//'selectAll' 全选 'mealSelect' 套餐
touchTab = await driver.waitForElementByAccessibilityId('editCart',5000);//编辑
await touchTab.click();
... ... @@ -33,17 +31,25 @@ describe(iOS_BUSINESS_SHOPPING,'购物车', async(driver) => {
touchTab = await driver.waitForElementByAccessibilityId('确定', 2000);//下单
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('shared back icon', 2000);//返回
await touchTab.click();
////XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[3]
touchTab = await driver.waitForElementByAccessibilityId('yh_paymentcenter_checked', 2000);//下单
touchTab = await driver.waitForElementByAccessibilityId('确认离开', 2000);//返回
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('支 付', 2000);//下单
touchTab = await driver.waitForElementByAccessibilityId('shared back icon', 2000);//返回
await touchTab.click();
////XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[3]
// touchTab = await driver.waitForElementByAccessibilityId('yh_paymentcenter_checked', 2000);//下单
// await touchTab.click();
// touchTab = await driver.waitForElementByAccessibilityId('支 付', 2000);//拉起支付
// await touchTab.click();
await new Promise(r => {
setTimeout(() => {
r()
}, 2000);
}, 3000);
})
});
\ No newline at end of file
... ...
... ... @@ -3,9 +3,35 @@ const {describe} = require('../../libs/driver');
const {iOS_TAB_MINE} = require('../../scene-types/scene-types');
describe(iOS_TAB_MINE,'我的', async(driver) => {
let touchTab = await driver.waitForElementByAccessibilityId('ufoBannerBg',10000);
let touchTab = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[5]',6000);
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 touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('shared back icon', 2000);
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 touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('cpsBannerBg',5000);
touchTab = await driver.waitForElementByAccessibilityId('我的收入', 2000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('market back', 2000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('商家入驻', 2000);
await touchTab.click();
let element = await driver.elementsByAccessibilityId("完善信息");
if (await element.isDisplayed()){
touchTab = await driver.waitForElementByAccessibilityId('完善信息');
await touchTab.click();
}
touchTab = await driver.waitForElementByAccessibilityId('market back', 2000);
await touchTab.click();
});
\ No newline at end of file
... ...