|
1 | | -import TestHelpers from '../helpers'; |
2 | | -import { |
3 | | - TAB_BAR_ACTION_BUTTON, |
4 | | - TAB_BAR_BROWSER_BUTTON, |
5 | | - TAB_BAR_SETTING_BUTTON, |
6 | | - TAB_BAR_WALLET_BUTTON, |
7 | | - TAB_BAR_ACTIVITY_BUTTON, |
8 | | -} from '../../wdio/screen-objects/testIDs/Components/TabBar.testIds'; |
| 1 | +import Matchers from '../utils/Matchers'; |
| 2 | +import Gestures from '../utils/Gestures'; |
| 3 | +import { TabBarSelectorIDs } from '../selectors/TabBar.selectors'; |
9 | 4 |
|
10 | | -export default class TabBarComponent { |
11 | | - static async tapBrowser() { |
12 | | - await TestHelpers.delay(2500); |
13 | | - await TestHelpers.waitAndTap(TAB_BAR_BROWSER_BUTTON); |
14 | | - await TestHelpers.delay(1000); |
| 5 | +class TabBarComponent { |
| 6 | + get tabBarBrowserButton() { |
| 7 | + return Matchers.getElementByID(TabBarSelectorIDs.BROWSER); |
15 | 8 | } |
16 | 9 |
|
17 | | - static async tapWallet() { |
18 | | - await TestHelpers.waitAndTap(TAB_BAR_WALLET_BUTTON); |
| 10 | + get tabBarWalletButton() { |
| 11 | + return Matchers.getElementByID(TabBarSelectorIDs.WALLET); |
19 | 12 | } |
20 | 13 |
|
21 | | - static async tapActions() { |
22 | | - await TestHelpers.delay(3000); |
23 | | - await TestHelpers.waitAndTap(TAB_BAR_ACTION_BUTTON); |
| 14 | + get tabBarActionButton() { |
| 15 | + return Matchers.getElementByID(TabBarSelectorIDs.ACTIONS); |
24 | 16 | } |
25 | 17 |
|
26 | | - static async tapSettings() { |
27 | | - await TestHelpers.waitAndTap(TAB_BAR_SETTING_BUTTON); |
| 18 | + get tabBarSettingButton() { |
| 19 | + return Matchers.getElementByID(TabBarSelectorIDs.SETTING); |
28 | 20 | } |
29 | 21 |
|
30 | | - static async tapActivity() { |
31 | | - await TestHelpers.waitAndTap(TAB_BAR_ACTIVITY_BUTTON); |
| 22 | + get tabBarActivityButton() { |
| 23 | + return Matchers.getElementByID(TabBarSelectorIDs.ACTIVITY); |
| 24 | + } |
| 25 | + |
| 26 | + async tapBrowser() { |
| 27 | + await Gestures.waitAndTap(this.tabBarBrowserButton); |
| 28 | + } |
| 29 | + |
| 30 | + async tapWallet() { |
| 31 | + await Gestures.waitAndTap(this.tabBarWalletButton); |
| 32 | + } |
| 33 | + |
| 34 | + async tapActions() { |
| 35 | + await Gestures.waitAndTap(this.tabBarActionButton); |
| 36 | + } |
| 37 | + |
| 38 | + async tapSettings() { |
| 39 | + await Gestures.waitAndTap(this.tabBarSettingButton); |
| 40 | + } |
| 41 | + |
| 42 | + async tapActivity() { |
| 43 | + await Gestures.waitAndTap(this.tabBarActivityButton); |
32 | 44 | } |
33 | 45 | } |
| 46 | + |
| 47 | +export default new TabBarComponent(); |
0 commit comments