-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathUserPage.ts
47 lines (38 loc) · 1.75 KB
/
UserPage.ts
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
import Page from "./Page";
class UserPage extends Page{
get currentUser () {return $('//*[@text=\'CURRENT USER\']')}
get workspaceButton () {return $('//*[@text=\'WORKSPACE\']')}
get switchButton () {return $('//*[@text=\'SWITCH\']')}
get logOutButton () {return $('//android.widget.Button[contains(@text, \'LOG\')]')}
get addAnotherUserButton () {return $('//*[@text=\'ADD ANOTHER USER\']')}
get refreshButton () {return $('//*[@text=\'REFRESH\']')}
async getCurrentUserText(){
await this.currentUser.waitForDisplayed({timeout:await this.getWaiterTimeForElement()})
return await this.currentUser.getText()
}
async getCurrentUserIsDisplayed(){
await this.currentUser.waitForDisplayed({timeout:await this.getWaiterTimeForElement()})
return await this.currentUser.isDisplayed()
}
async workspaceButtonClick(){
await this.workspaceButton.waitForDisplayed({timeout:await this.getWaiterTimeForElement()})
await this.workspaceButton.click()
}
async switchButtonClick(){
await this.switchButton.waitForDisplayed({timeout:await this.getWaiterTimeForElement()})
await this.switchButton.click()
}
async addAnotherUserButtonClick(){
await this.addAnotherUserButton.waitForDisplayed({timeout:await this.getWaiterTimeForElement()})
await this.addAnotherUserButton.click()
}
async refreshButtonClick(){
await this.refreshButton.waitForDisplayed({timeout:await this.getWaiterTimeForElement()})
await this.refreshButton.click()
}
async logOutButtonClick(){
await this.logOutButton.waitForDisplayed({timeout:await this.getWaiterTimeForElement()})
await this.logOutButton.click()
}
}
export default new UserPage()