|
|
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 |
...
|
...
|
|