case_tabmain_switch.js
1.27 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
const wd = require('wd');
const {describe} = require('../../libs/driver');
const {ANDROID_MAINTAB_SWITCH} = require('../../scene-types/scene-types');
const {FIND_VIEW_OVER_TIME, ACTION_PAUSE_TIME} = require('../../config/constant');
describe(ANDROID_MAINTAB_SWITCH,'安卓首页TAB切换', async(driver) => {
// 首页tab
let touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_home_rl',10000);
await touchTab.click();
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
// 分类tab
touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_sort_rl',10000);
await touchTab.click();
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
// 社区tab
touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_stroll_rl',10000);
await touchTab.click();
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
// 个人中心tab
touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_my_rl',10000);
await touchTab.click();
// 暂停
await driver.sleep(ACTION_PAUSE_TIME);
// UFO
touchTab = await driver.waitForElementById('com.yoho:id/tabMain_radioImage_ufo_rl',10000);
await touchTab.click();
// 暂停
await driver.sleep(10000);
});