1
|
const wd = require('wd');
|
1
|
const wd = require('wd');
|
2
|
const {describe} = require('../../libs/driver');
|
2
|
const {describe} = require('../../libs/driver');
|
3
|
const {iOS_TAB_UFOHOME} = require('../../scene-types/scene-types');
|
3
|
const {iOS_TAB_UFOHOME} = require('../../scene-types/scene-types');
|
4
|
-
|
|
|
5
|
-describe(iOS_TAB_UFOHOME,'UFO首页', async(driver) => {
|
|
|
6
|
-
|
4
|
+const { FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME } = require('../../config/constant');
|
|
|
5
|
+describe(iOS_TAB_UFOHOME, "球鞋市集", async (driver) => {
|
|
|
6
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
7
|
+ console.log("点击球鞋市集tab");
|
|
|
8
|
+ let tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[3]', FIND_VIEW_OVER_TIME);
|
|
|
9
|
+ tapView.click();
|
|
|
10
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
11
|
+ console.log("点击首页tab");
|
|
|
12
|
+ tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeTabBar/XCUIElementTypeButton[1]', FIND_VIEW_OVER_TIME);
|
|
|
13
|
+ tapView.click();
|
|
|
14
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
15
|
+ console.log("点击首页搜索框");
|
|
|
16
|
+ tapView = await driver.waitForElementByAccessibilityId('homeSearch', FIND_VIEW_OVER_TIME);
|
|
|
17
|
+ tapView.click();
|
|
|
18
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
19
|
+ console.log("搜索框输入UFO");
|
|
|
20
|
+ tapView = await driver.waitForElementByAccessibilityId('yh_search_vc_search', FIND_VIEW_OVER_TIME);
|
|
|
21
|
+ tapView.sendKeys('ufo');
|
|
|
22
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
23
|
+ console.log("点击UFO");
|
|
|
24
|
+ tapView = await driver.waitForElementByXPath('//XCUIElementTypeStaticText[@name="ufo"]', FIND_VIEW_OVER_TIME);
|
|
|
25
|
+ tapView.click();
|
|
|
26
|
+ // await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
27
|
+ // console.log("点击UFO店铺");
|
|
|
28
|
+ // tapView = 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/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[1]/XCUIElementTypeOther', FIND_VIEW_OVER_TIME);
|
|
|
29
|
+ // tapView.click();
|
|
|
30
|
+ // await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
31
|
+ // console.log("点返回1");
|
|
|
32
|
+ // tapView = await driver.waitForElementByXPath('//XCUIElementTypeApplication[@name="Yoho!Buy有货"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther', FIND_VIEW_OVER_TIME);
|
|
|
33
|
+ // tapView.click();
|
|
|
34
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
35
|
+ console.log("点击UFO商品");
|
|
|
36
|
+ tapView = 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]', FIND_VIEW_OVER_TIME);
|
|
|
37
|
+ tapView.click();
|
|
|
38
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
39
|
+ console.log("点击收藏");
|
|
|
40
|
+ tapView = await driver.waitForElementByAccessibilityId('yh_ufo_prd_detail_collect_btn', FIND_VIEW_OVER_TIME);
|
|
|
41
|
+ tapView.click();
|
|
|
42
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
43
|
+ console.log("取消收藏");
|
|
|
44
|
+ tapView = await driver.waitForElementByAccessibilityId('yh_ufo_prd_detail_collect_btn', FIND_VIEW_OVER_TIME);
|
|
|
45
|
+ tapView.click();
|
|
|
46
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
47
|
+ console.log("点返回搜索页");
|
|
|
48
|
+ tapView = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
|
|
|
49
|
+ tapView.click();
|
|
|
50
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
|
|
51
|
+ console.log("点返回首页");
|
|
|
52
|
+ tapView = await driver.waitForElementByAccessibilityId('yh_base_vc_back_btn', FIND_VIEW_OVER_TIME);
|
|
|
53
|
+ tapView.click();
|
|
|
54
|
+ await driver.sleep(ACTION_PAUSE_TIME);
|
7
|
}); |
55
|
}); |