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.Clicks;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.ib.loans.flexicredit.contract.FlexicreditOverdraftAmountPage.MINIMAL_PAYMENT_CONSENT;
import static cz.moneta.test.dsl.ib.loans.flexicredit.contract.FlexicreditOverdraftAmountPage.OVERDRAFT_HEADER_TEXT;

@Wait({OVERDRAFT_HEADER_TEXT, MINIMAL_PAYMENT_CONSENT})
public interface FlexicreditOverdraftAmountPage extends IbPageFlow<FlexicreditOverdraftAmountPage>, FlexicreditApplicationPage {
    String OVERDRAFT_HEADER_TEXT = "//span[text() = 'Schválili jsme Vám následující možnosti']";
    String MINIMAL_PAYMENT_CONSENT = "//span[text() = 'Zajistím, aby mi na účet přišlo každý měsíc, alespoň požadované minimum 1000 Kč']//ancestor::label//input[@name = 'minimalPaymentConsent']";

    @Clicks(value = {
            @Click(value = MINIMAL_PAYMENT_CONSENT, jsClick = true),
            @Click(value = CONTINUE_BUTTON, jsClick = true)})
    FlexicreditPreContractInformation confirmAndContinueToPreContract();

}
