package cz.moneta.test.dsl.ib.loans.flexicredit.contract;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.dsl.ib.loans.flexicredit.FlexicreditApplicationPage;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.ib.loans.flexicredit.contract.FlexicreditPreContractInformation.PRE_CONTRACT_HEADER_TEXT;
import static cz.moneta.test.dsl.ib.loans.flexicredit.contract.FlexicreditPreContractInformation.TO_READ_CONTRACT_BUTTON;

@Wait({PRE_CONTRACT_HEADER_TEXT, TO_READ_CONTRACT_BUTTON})
public interface FlexicreditPreContractInformation extends IbPageFlow<FlexicreditPreContractInformation>, FlexicreditApplicationPage {
    String PRE_CONTRACT_HEADER_TEXT = "//span[text() = 'Předsmluvní informace']";
    String TO_READ_CONTRACT_BUTTON = "//span[text() = 'Přečíst']//parent::button";

    @Wait(TO_READ_CONTRACT_BUTTON)
    @Click(value = TO_READ_CONTRACT_BUTTON, jsClick = true)
    FlexicreditContractInformationPage readContract();
}
