tab_category.js
3.95 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const wd = require('wd');
const {describe} = require('../../libs/driver');
const {iOS_TAB_CATEGORY} = require('../../scene-types/scene-types');
const { FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME } = require('../../config/constant');
describe(iOS_TAB_CATEGORY,'分类(品类&品牌)', async(driver) => {
//点击首页的tab bar 分类按钮
let tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[2]', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择左侧的分类点击 第二个
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('YH_LeftCategoryView_1', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择左侧的分类点击 第三个
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('YH_LeftCategoryView_2', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择左侧的分类点击 第四个
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('YH_LeftCategoryView_3', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 生活方式点击
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_2', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 女装点击
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_1', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 潮童点击
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_3', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 高街BLK点击
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_4', FIND_VIEW_OVER_TIME);
await tapView.click();
//选择 男装点击
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_0', FIND_VIEW_OVER_TIME);
await tapView.click();
//点击分类中的 其中一个分类
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_categoryCell_1', FIND_VIEW_OVER_TIME);
await tapView.click();
console.log("回到品类首页");
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
tapView.click();
console.log("点击品牌");
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_brand_nav_btn', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_2', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_4', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_3', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_1', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_SlideSegmentControl_0', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
tapView = await driver.waitForElementByAccessibilityId('yh_category_nav_btn', FIND_VIEW_OVER_TIME);
tapView.click();
await driver.sleep(ACTION_PAUSE_TIME);
});