forked from BugorDmitriy/OpenWeatherJavaProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomePage.java
More file actions
82 lines (53 loc) · 1.74 KB
/
Copy pathHomePage.java
File metadata and controls
82 lines (53 loc) · 1.74 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
package pages.home;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import java.util.List;
public class HomePage extends HomeTopMenuPage<HomePage> {
@FindBy(xpath = "//div[@class = 'panel-body']")
WebElement notification;
@FindBy(id = "user-dropdown")
WebElement userTopMenu;
@FindBy(xpath = "//ul[@id='user-dropdown-menu']/li")
List<WebElement> userDropdownMenuLinks;
@FindBy(xpath = "//ul[@id='myTab']//a[@href='/api_keys']")
private WebElement apiKeysTab;
@FindBy(xpath = "//h2")
private List<WebElement> h2Headers;
@FindBy(className = "btn_like")
private List<WebElement> orangeButtons;
@FindBy(xpath = "//ul[@class='nav nav-tabs pull-left']//a")
private List<WebElement> navTabs;
public HomePage(WebDriver driver) {
super(driver);
}
public HomePage createGeneric() {
return new HomePage(getDriver());
}
public String getNotification() {
return getText(notification);
}
public List<String> getUserNameDropdownMenuTexts() {
return getTexts(userDropdownMenuLinks);
}
public HomeAPIKeysPage clickAPIKeysTab() {
click(apiKeysTab);
return new HomeAPIKeysPage(getDriver());
}
public List<String> getListH2Headers() {
return getTexts(h2Headers);
}
public String getUserMenuText() {
return getText(userTopMenu);
}
public HomePage clickUserNameMenu() {
click(userTopMenu);
return this;
}
public List<WebElement> getOrangeButtons() {
return orangeButtons;
}
public void waitUntilButtonIsClickable(WebElement button) {
wait10ElementToBeClickable(button);
}
}