package cz.moneta.test.dsl.ufo.banka.pages.products.consolidation;

import cz.moneta.test.dsl.ufo.banka.pages.main.DOK001_S001_SelectionOfSubmittedDocumentsPage;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.products.consolidation.UDC001_S001_ConsolidationPartOnePage.PAGE_ID;
import static cz.moneta.test.dsl.ufo.banka.pages.products.consolidation.UDC001_S001_ConsolidationPartOnePage.TOTAL_LOAN_AMOUNT;

@Wait(value = {PAGE_ID, TOTAL_LOAN_AMOUNT}, waitSecondsForElement = 30)
public interface UDC001_S001_ConsolidationPartOnePage extends WebFlow<UDC001_S001_ConsolidationPartOnePage> {

    String PAGE_ID = "UDC001_S001_X001";
    String TOTAL_LOAN_AMOUNT = "UDC001_S001_E006";
    String REQUIRED_INCREASE = "UDC001_S001_E018";
    String NUMBER_OF_INSTALLMENTS = "UDC001_S001_C003";
    String CALCULATION_OF_PAYMENT_BUTTON = "UDC001_S001_B004";
    String BUSY_LOADER_XPATH = "//img[@class=\"gtw-Image\"]/@src";
    String CONTINUE_BUTTON = "UDC001_S001_B002";


    @TypeInto(TOTAL_LOAN_AMOUNT)
    UDC001_S001_ConsolidationPartOnePage typeIntoTotalLoanAmount(String totalLoanAmount);

    @TypeInto(REQUIRED_INCREASE)
    UDC001_S001_ConsolidationPartOnePage typeIntoRequiredIncrease(String requiredIncrease);

    @Select(NUMBER_OF_INSTALLMENTS)
    UDC001_S001_ConsolidationPartOnePage selectNumberOfInstallments(String numberOfInstallments);

    @Click(value = CALCULATION_OF_PAYMENT_BUTTON, andWait = @Wait(value = BUSY_LOADER_XPATH, until = Until.GONE))
    UDC001_S001_ConsolidationPartOnePage clickCalculationOfPaymentButton();

    @Click(CONTINUE_BUTTON)
    DOK001_S001_SelectionOfSubmittedDocumentsPage clickContinueButtonToDocumentPage();

}