package com.mavlushechka.a1qa.pages; import com.mavlushechka.a1qa.elements.Label; import com.mavlushechka.a1qa.models.Interest; import com.mavlushechka.a1qa.models.User; import org.openqa.selenium.By; public class GamePage extends BaseForm { private final LoginCardForm loginCardForm = new LoginCardForm(); private final InterestsCardForm interestsCardForm = new InterestsCardForm(); 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 loginCardForm.isOpened(); } public void performAuthorization(User user) { loginCardForm.performAuthorization(user); } public boolean isSecondCardOpened() { return interestsCardForm.isOpened(); } public void select(Interest interest) { interestsCardForm.select(interest); } public void clickDownloadImageButton() { interestsCardForm.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(); } }