-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathHeaderComponent.java
More file actions
48 lines (38 loc) · 1.27 KB
/
HeaderComponent.java
File metadata and controls
48 lines (38 loc) · 1.27 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
package github.pages.components;
import com.frameworkium.core.htmlelements.element.*;
import com.frameworkium.core.ui.annotations.Visible;
import com.frameworkium.core.ui.pages.PageFactory;
import github.pages.*;
import io.qameta.allure.Step;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
@FindBy(css = "header")
public class HeaderComponent extends HtmlElement {
@Visible
@FindBy(css = "a.header-logo-invertocat")
private Link homeLink;
@FindBy(name = "q")
private TextInput searchBox;
@Visible
@FindBy(partialLinkText = "Explore")
private Link exploreLink;
@Visible
@FindBy(partialLinkText = "Marketplace")
private WebElement marketingLink;
@Step("Go Home")
public HomePage clickLogo() {
homeLink.click();
return PageFactory.newInstance(HomePage.class);
}
@Step("Go to the explore page")
public ExplorePage clickExplore() {
exploreLink.click();
return PageFactory.newInstance(ExplorePage.class);
}
@Step("Search for the text \"{0}\"")
public SearchResultsPage search(String searchText) {
searchBox.sendKeys(searchText + Keys.ENTER);
return PageFactory.newInstance(SearchResultsPage.class);
}
}