package cz.moneta.test.dsl.ufo.banka.pages.search;

import cz.moneta.test.dsl.ufo.banka.UfoBankaPageFlow;
import cz.moneta.test.dsl.ufo.banka.pages.menu.vertical.VerticalMenu;
import cz.moneta.test.harness.support.web.CheckElementPresent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Lookup;
import cz.moneta.test.harness.support.web.Select;
import cz.moneta.test.harness.support.web.TypeInto;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.ufo.banka.pages.search.KAL003_S006_ExpresCalculator.CALCULATE_BUTTON;
import static cz.moneta.test.dsl.ufo.banka.pages.search.KAL003_S006_ExpresCalculator.KAL003_S006_PAGE_LABEL_XPATH;

@Wait(value = KAL003_S006_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 90)
@Wait(value = CALCULATE_BUTTON, waitSecondsForElement = 90)
public interface KAL003_S006_ExpresCalculator extends UfoBankaPageFlow<KAL003_S006_ExpresCalculator>, VerticalMenu {
    String KAL003_S006_PAGE_LABEL_XPATH = "//div[text()='KAL003_S006']";
    String CALCULATE_BUTTON = "KAL003_S006_B002";
    String NAME_INPUT = "KAL003_S006_E006";
    String CLIENT_TYPE_SELECT = "KAL003_S006_C003";
    String PRODUCT_RADIO = "KAL003_S006_R001_5099003";
    String AMOUNT_INPUT = "KAL003_S006_E001";
    String NUMBER_OF_PAYMENTS_SELECT = "KAL003_S006_C002";
    String INSURANCE_SELECT = "KAL003_S006_C001";
    String LOAN_FEE_CALCULATION_XPATH = "//table[@id='KAL003_S006_G001_UfoTable']//td[text()='Poplatek za poskytnutí půjčky']";

    @Click(CALCULATE_BUTTON)
    KAL003_S006_ExpresCalculator clickCalculate();

    @TypeInto(NAME_INPUT)
    KAL003_S006_ExpresCalculator fillName(String name);

    @Select(CLIENT_TYPE_SELECT)
    KAL003_S006_ExpresCalculator selectClientType(String clientType);

    @Click(value = PRODUCT_RADIO, jsClick = true)
    KAL003_S006_ExpresCalculator clickProduct();

    @TypeInto(AMOUNT_INPUT)
    KAL003_S006_ExpresCalculator fillAmount(String amount);

    @Select(NUMBER_OF_PAYMENTS_SELECT)
    KAL003_S006_ExpresCalculator selectNumberOfPayments(String numberOfPayments);

    @Select(INSURANCE_SELECT)
    KAL003_S006_ExpresCalculator selectInsurance(String insurance);

    @CheckElementPresent(value = LOAN_FEE_CALCULATION_XPATH, by = Lookup.XPATH)
    KAL003_S006_ExpresCalculator checkLoanFeeCalculated();
}

