-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathHomePage.java
More file actions
40 lines (31 loc) · 1.21 KB
/
HomePage.java
File metadata and controls
40 lines (31 loc) · 1.21 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
package angularjs.pages;
import com.frameworkium.core.ui.UITestLifecycle;
import com.frameworkium.core.ui.annotations.Visible;
import com.frameworkium.core.ui.pages.BasePage;
import com.frameworkium.core.ui.pages.PageFactory;
import io.qameta.allure.Step;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import java.time.Duration;
public class HomePage extends BasePage<HomePage> {
@Visible
@FindBy(xpath = "//a[text()='Develop']")
private WebElement developDropdown;
@FindBy(xpath = "//a[text()='Developer Guide']")
private WebElement developerGuideMenuItem;
@Step("Open home page")
public static HomePage open() {
UITestLifecycle.get().getWebDriver().manage().timeouts().pageLoadTimeout(Duration.ofSeconds(30));
return PageFactory.newInstance(HomePage.class, "https://angularjs.org/");
}
@Step("Click developer guide drop down menu")
public HomePage clickDevelopMenu() {
developDropdown.click();
return this;
}
@Step("Click developer guide link")
public DeveloperGuidePage clickDeveloperGuideLink() {
developerGuideMenuItem.click();
return PageFactory.newInstance(DeveloperGuidePage.class);
}
}