-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSidebarScreen.page.js
More file actions
77 lines (68 loc) · 2.05 KB
/
Copy pathSidebarScreen.page.js
File metadata and controls
77 lines (68 loc) · 2.05 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
import { $ } 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 followerRequestsButton() {
return $('android=new UiSelector().text("Follower requests")');
}
get currentUsername() {
return $('~sidebar-current-username');
}
get followingCount() {
return $('~sidebar-following-count');
}
get followersCount() {
return $('~sidebar-followers-count');
}
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 isDisplayed() {
return (
(await this.logoutButton.isDisplayed()) &&
(await this.accountSwitcherButton.isDisplayed()) &&
(await this.settingsButton.isDisplayed()) &&
(await this.profileButton.isDisplayed()) &&
(await this.chatButton.isDisplayed()) &&
(await this.followerRequestsButton.isDisplayed())
);
}
}
export default new SidebarScreen();