-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSidebarScreen.page.js
More file actions
128 lines (112 loc) · 3.25 KB
/
Copy pathSidebarScreen.page.js
File metadata and controls
128 lines (112 loc) · 3.25 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { $, driver } from '@wdio/globals';
class SidebarScreen {
get logoutButton() {
return $('android=new UiSelector().text("Log out")');
}
get accountSwitcherButton() {
return $('~open-account-switcher-button');
}
get logoutButtonFromAccountSwitcher() {
return $('android=new UiSelector().text("Log out from current account")');
}
get settingsButton() {
return $('android=new UiSelector().text("Settings and privacy")');
}
get profileButton() {
return $('android=new UiSelector().text("Profile")');
}
get chatButton() {
return $('android=new UiSelector().text("Chat")');
}
get currentUsername() {
return $('~sidebar-current-username');
}
get followingCount() {
return $('~sidebar-following-count');
}
get followersCount() {
return $('~sidebar-followers-count');
}
get themeSwitcherButton() {
return $('~theme-switcher-drawer');
}
get darkThemeButton() {
return $('android=new UiSelector().text("On")');
}
get lightThemeButton() {
return $('android=new UiSelector().text("Off")');
}
get systemThemeButton() {
return $('android=new UiSelector().text("Use device settings")');
}
async openThemeSwitcher() {
await this.themeSwitcherButton.waitForDisplayed();
await this.themeSwitcherButton.click();
}
async chooseDarkTheme() {
await this.darkThemeButton.waitForDisplayed();
await this.darkThemeButton.click();
}
async chooseLightTheme() {
await this.lightThemeButton.waitForDisplayed();
await this.lightThemeButton.click();
}
async chooseSystemTheme() {
await this.systemThemeButton.waitForDisplayed();
await this.systemThemeButton.click();
}
async goBack() {
await driver.back();
await driver.pause(500);
}
get followingButton() {
return $('~sidebar-following-button');
}
get followersButton() {
return $('~sidebar-followers-button');
}
async logout() {
await this.logoutButton.waitForDisplayed();
await this.logoutButton.click();
}
async openAccountSwitcherDrawer() {
await this.accountSwitcherButton.waitForDisplayed();
await this.accountSwitcherButton.click();
}
async logoutFromAccountSwitcher() {
await this.logoutButtonFromAccountSwitcher.waitForDisplayed();
await this.logoutButtonFromAccountSwitcher.click();
}
async goToSettings() {
await this.settingsButton.waitForDisplayed();
await this.settingsButton.click();
}
async goToProfile() {
await this.profileButton.waitForDisplayed();
await this.profileButton.click();
}
async goToChat() {
await this.chatButton.waitForDisplayed();
await this.chatButton.click();
}
async goToFollowing() {
await this.followingButton.waitForDisplayed();
await this.followingButton.click();
await driver.pause(500);
}
async goToFollowers() {
await this.followersButton.waitForDisplayed();
await this.followersButton.click();
await driver.pause(500);
}
async isDisplayed() {
return (
(await this.logoutButton.isDisplayed()) &&
(await this.accountSwitcherButton.isDisplayed()) &&
(await this.settingsButton.isDisplayed()) &&
(await this.profileButton.isDisplayed()) &&
(await this.chatButton.isDisplayed())
);
}
}
export default new SidebarScreen();