package cz.moneta.test.dsl.newib.savings;

import cz.moneta.test.dsl.newib.NewIbPageFlow;
import cz.moneta.test.dsl.newib.mainpage.BuildingSavingsPage;
import cz.moneta.test.harness.support.web.CheckElementPresent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.newib.savings.ContractPage.CONTRACT_TITLE_XPATH;

@Wait(value = {CONTRACT_TITLE_XPATH}, waitSecondsForElement = 30)
public interface ContractPage extends NewIbPageFlow<ContractPage> {

    String CONTRACT_TITLE_XPATH = "//h2[@class='t-title t-title--h4'][text()='Přečtěte si smlouvu s parametry produktu']";
    String UNDERSTAND_AND_AGREE_BUTTON_XPATH = "//button[@data-testid='goNext'][text()='Rozumím a souhlasím, pokračovat k podpisu']";
    String DECLINE_BUTTON_XPATH = "//button[@data-testid='decline'][text()='Nesouhlasím']";

    @Click(UNDERSTAND_AND_AGREE_BUTTON_XPATH)
    BuildingSavingsPage clickOnUnderstandAndAgreeButton();

    @CheckElementPresent(DECLINE_BUTTON_XPATH)
    ContractPage checkDeclineButton();
}