tab_home.js 2.36 KB
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);
    await touchTab.click();
    await new Promise(r => {
        setTimeout(() => {
            r()
        }, 2000);
    })
    await (new wd.TouchAction(driver))
    .longPress({x: 300, y: 158})
    .moveTo({x: 290, y: 162})
    .release()
    .perform()

    // touchTab = await driver.waitForElementByAccessibilityId('homeSearch',5000);
    // await touchTab.click();

    // touchTab = await driver.waitForElementByAccessibilityId('home message center',10000);
    // await touchTab.click();

    // touchTab = await driver.waitForElementByAccessibilityId('qr home',10000);
    // await touchTab.click();

    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();

    await new Promise(r => {
        setTimeout(() => {
            r()
        }, 5000);
    })


});