...
|
...
|
@@ -8,40 +8,52 @@ describe(IOS_PRODUCT_DETAIL, '商品详情页埋点测试', async(driver) => { |
|
|
//点击分类中的 其中一个分类
|
|
|
let category = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[3]/XCUIElementTypeCollectionView/XCUIElementTypeCell[4]/XCUIElementTypeOther', 3000);
|
|
|
await category.click();
|
|
|
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[2]/XCUIElementTypeOther/XCUIElementTypeOther', 3000);
|
|
|
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);
|
|
|
await firstProduct.click();
|
|
|
console.log("点击其中一个商品完成");
|
|
|
//进入购物车
|
|
|
let goToShopCart = await driver.waitForElementByAccessibilityId('indicator shoppingbag', 3000);
|
|
|
await goToShopCart.click();
|
|
|
console.log("进入购物车完成");
|
|
|
//返回商品详情
|
|
|
let backPrdDetail = await driver.waitForElementByAccessibilityId('shared back icon', 3000);
|
|
|
await backPrdDetail.click();
|
|
|
console.log("返回详情完成");
|
|
|
//点击分享
|
|
|
let tapShare = await driver.waitForElementByAccessibilityId('yh prd share icon', 3000);
|
|
|
await tapShare.click();
|
|
|
console.log("点击分享完成");
|
|
|
//取消分享
|
|
|
let cancelShare = await driver.waitForElementByAccessibilityId('取消', 3000);
|
|
|
await cancelShare.click();
|
|
|
console.log("取消完成");
|
|
|
//点击加入购物车
|
|
|
let addToCart = await driver.waitForElementByAccessibilityId('加入购物车', 3000);
|
|
|
await addToCart.click();
|
|
|
console.log("点击选择颜色尺码弹窗完成");
|
|
|
//选择颜色
|
|
|
let chooseColor = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[1]/XCUIElementTypeStaticText[1]', 3000);
|
|
|
await chooseColor.click();
|
|
|
console.log("完成选择颜色");
|
|
|
//选择尺码
|
|
|
let chooseSize = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[2]/XCUIElementTypeStaticText[1]', 3000);
|
|
|
await chooseSize.click();
|
|
|
console.log("完成选择尺码");
|
|
|
//加一下
|
|
|
let chooseAdd = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[3]/XCUIElementTypeButton[1]', 3000);
|
|
|
await chooseAdd.click();
|
|
|
console.log("点击加一件");
|
|
|
//减一下
|
|
|
let chooseReduce = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[3]/XCUIElementTypeButton[2]', 3000);
|
|
|
await chooseReduce.click();
|
|
|
console.log("点击减一件");
|
|
|
//点击加入购物车
|
|
|
let add = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeButton[2]', 3000);
|
|
|
await add.click();
|
|
|
|
|
|
console.log("点加购物车");
|
|
|
await new Promise(r => {
|
|
|
setTimeout(() => {
|
|
|
r()
|
...
|
...
|
|