Repository navigation
Expand file tree
/
Copy pathWelcomePageObject.java
More file actions
69 lines (57 loc) · 2.1 KB
/
Copy pathWelcomePageObject.java
File metadata and controls
69 lines (57 loc) · 2.1 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
package lib.ui;
import org.openqa.selenium.remote.RemoteWebDriver;
public class WelcomePageObject extends MainPageObject {
private static final String
STEP_LEARN_MORE_LINK = "id:Learn more about Wikipedia",
STEP_NEW_WAYS_TO_EXPLORE_TEXT = "id:New ways to explore",
STEP_ADD_OR_EDIT_PREFERRED_LANG_LINK = "id:Add or edit preferred languages",
STEP_LEARN_MORE_ABOUT_DATA_COLLECTED_LINK = "id:Learn more about data collected",
NEXT_LINK = "id:Next",
GET_STARTED_BUTTON = "id:Get started",
SKIP = "id:Skip";
public WelcomePageObject(RemoteWebDriver driver) {
super(driver);
}
public void waitForLearnMoreLink() {
this.waitForElementPresent(
STEP_LEARN_MORE_LINK,
"Cannot find 'Learn more about Wikipedia' link",
10);
}
public void waitForNewWayToExploreText() {
this.waitForElementPresent(
STEP_NEW_WAYS_TO_EXPLORE_TEXT,
"Cannot find 'New ways to explore' text",
10);
}
public void waitForAddOrEditPreferredLangText() {
this.waitForElementPresent(
STEP_ADD_OR_EDIT_PREFERRED_LANG_LINK,
"Cannot find 'Add or edit preferred languages' link",
10);
}
public void waitForLearnMoreAboutDataCollectedText() {
this.waitForElementPresent(
STEP_LEARN_MORE_ABOUT_DATA_COLLECTED_LINK,
"Cannot find 'Learn more about data collected' link",
10);
}
public void clickNextButton() {
this.waitForElementAndClick(
NEXT_LINK,
"Cannot find and click 'Next' link",
10);
}
public void clickGetStartedButton() {
this.waitForElementAndClick(
GET_STARTED_BUTTON,
"Cannot find and click 'Get started' link",
10);
}
public void clickSkip() {
this.waitForElementAndClick(
SKIP,
"Cannot find and click skip button",
5);
}
}