tab_home.js
1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const wd = require('wd');
const {describe} = require('../../libs/driver');
const {iOS_TAB_HOME} = require('../../scene-types/scene-types');
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))
// .press({x: 300, y: 158})
// .moveTo({x: 191, 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();
let touchTab = await driver.waitForElementByAccessibilityId('球鞋',5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('男装', 5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('女装',5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('生活方式',5000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('高街BLK', 1000);
await touchTab.click();
touchTab = await driver.waitForElementByAccessibilityId('潮童',5000);
await touchTab.click();
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);
})
});