blob: 5536fd2125527801f4aef27166f035401b877b49 (
plain)
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
|
package com.mavlushechka.a1qa.pages;
import com.mavlushechka.a1qa.elements.Label;
import com.mavlushechka.a1qa.constants.Interest;
import com.mavlushechka.a1qa.models.User;
import org.openqa.selenium.By;
import java.util.List;
public class GamePage extends BaseForm {
private final LoginForm loginForm = new LoginForm();
private final InterestsForm interestsForm = new InterestsForm();
private final HelpForm helpForm = new HelpForm();
private final CookiesForm cookiesForm = new CookiesForm();
private final Label timer = new Label(By.xpath("//*[contains(@class, 'timer')]"), "Timer");
public GamePage() {
super(new Label(By.xpath("//*[@id='app']//*[contains(@class, 'game')]"), "Game view"), "Game");
}
public boolean isFirstCardFormOpened() {
return loginForm.isOpened();
}
public void performAuthorization(User user) {
loginForm.performAuthorization(user);
}
public boolean isSecondCardOpened() {
return interestsForm.isOpened();
}
public void select(List<Interest> interests) {
for (Interest interest : interests) {
interestsForm.select(interest);
}
}
public void clickDownloadImageButton() {
interestsForm.clickDownloadImageButton();
}
public void hideHelpForm() {
helpForm.hide();
}
public boolean isHelpFormHidden() {
return helpForm.isHidden();
}
public void acceptCookies() {
cookiesForm.accept();
}
public boolean isCookiesFormHidden() {
return cookiesForm.isHidden();
}
public String getTimerText() {
return timer.getText();
}
}
|