-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathSearchResultsPage.java
More file actions
40 lines (31 loc) · 1.09 KB
/
SearchResultsPage.java
File metadata and controls
40 lines (31 loc) · 1.09 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 github.pages;
import com.frameworkium.core.htmlelements.element.Link;
import com.frameworkium.core.ui.annotations.Visible;
import com.frameworkium.core.ui.pages.BasePage;
import com.frameworkium.core.ui.pages.PageFactory;
import github.pages.components.HeaderComponent;
import io.qameta.allure.Step;
import org.openqa.selenium.support.FindBy;
import java.util.List;
import java.util.stream.Collectors;
public class SearchResultsPage extends BasePage<SearchResultsPage> {
@Visible
private HeaderComponent header;
@Visible(checkAtMost = 1)
@FindBy(css = "h3 > a")
private List<Link> repoLinks;
public HeaderComponent theHeader() {
return header;
}
@Step("Navigate to the Github homepage")
public static SearchResultsPage open() {
return PageFactory.newInstance(
SearchResultsPage.class, "https://github.com");
}
@Step("Get the list of code repository names")
public List<String> getRepoNames() {
return repoLinks.stream()
.map(Link::getText)
.collect(Collectors.toList());
}
}