tab_mine.js 2.16 KB
const wd = require('wd');
const {describe} = require('../../libs/driver');
const {iOS_TAB_MINE} = require('../../scene-types/scene-types');

describe(iOS_TAB_MINE,'我的', async(driver) => {

    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('yh_base_vc_back_btn', 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('我的收入', 2000);
    await touchTab.click();

    touchTab = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', 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('yh_base_vc_back_btn', 2000);
    await touchTab.click();
    
});