package cz.moneta.test.dsl.ufo.banka.pages.products.mutual.funds;

import cz.moneta.test.dsl.ufo.banka.pages.common.pages.TIS046_S001_DocumentsProvidedToClientPage;
import cz.moneta.test.harness.endpoints.WebEndpoint;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.products.mutual.funds.INF001_S002_ContractData.CLIENT_STATEMENT_DISTRIBUTION;
import static cz.moneta.test.dsl.ufo.banka.pages.products.mutual.funds.INF001_S002_ContractData.INF001_S002_PAGE_LABEL_XPATH;

@Wait(value = INF001_S002_PAGE_LABEL_XPATH, by = Lookup.XPATH)
@Wait(CLIENT_STATEMENT_DISTRIBUTION)
public interface INF001_S002_ContractData extends WebFlow<INF001_S002_ContractData> {

    String INF001_S002_PAGE_LABEL_XPATH = "//div[text()='INF001_S002']";
    String CLIENT_STATEMENT_DISTRIBUTION = "INF001_S002_C007";
    String BU_RADIO_BTN = "INF001_S002_R002_1";
    String ACCOUNT_NUMBER_FOR_SETTLEMENT = "INF001_S002_C008";
    String SEND_AND_PRINT_BUTTON = "INF001_S002_B001";

    @Select(CLIENT_STATEMENT_DISTRIBUTION)
    INF001_S002_ContractData selectClientStatementDistribution(String clientStatementDistribution);

    @Click(BU_RADIO_BTN)
    INF001_S002_ContractData selectBuRadioBtn();

    @Wait(ACCOUNT_NUMBER_FOR_SETTLEMENT)
    @Select(ACCOUNT_NUMBER_FOR_SETTLEMENT)
    INF001_S002_ContractData selectAccountNumberForSettlement(String accountNumber);

    @Click(SEND_AND_PRINT_BUTTON)
    INF001_S002_ContractData clickSendAndPrintButton();

    @DismissAlert(waitSecondsForAlert = 3, expectedAlertText = "Klientovi je možné založit InternetBanku pro výpisy. Založte prosím InternetBanku a pak zvolte způsob distribuce výpisů *Elektronicky*.")
    TIS046_S001_DocumentsProvidedToClientPage dismissAlert();

    default void confirmAlertModalWindow(WebEndpoint endpoint) {
        endpoint.dismissAlert(80);
    }

}
