package cz.moneta.test.dsl.ufo.banka.pages.products.saving.accounts;

import cz.moneta.test.dsl.ufo.banka.pages.products.current.account.BPP001_S001_DocumentationSendPage;
import cz.moneta.test.dsl.ufo.banka.pages.requests.DUP009_S001_CreateElectronicDistributionChannel;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;
import static cz.moneta.test.dsl.ufo.banka.pages.products.saving.accounts.SPU001_S001_SavingAccountPage.*;

@Wait(value = SPU001_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
public interface SPU001_S001_SavingAccountPage extends WebFlow<SPU001_S001_SavingAccountPage> {
    String SPU001_S001_PAGE_LABEL_XPATH = "//div[text()='SPU001_S001']";

    String PRODUCT_SELECT = "SPU001_S001_C001";
    String CURRENT_ACCOUNT_SELECT = "SPU001_S001_C002";
    String FIRST_ACCOUNT_NUMBER_XPATH_SELECT = "//*[@id='SPU001_S001_C002']/option[2]";
    String STATEMENT_DISTRIBUTION_SELECT = "SPU001_S001_C005";
    String STATEMENT_PERIODICITY = "SPU001_S001_C006";
    String SEND_BUTTON = "SPU001_S001_B001";

    @Select(value = PRODUCT_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    SPU001_S001_SavingAccountPage selectProduct(String product);

    @Click(value = FIRST_ACCOUNT_NUMBER_XPATH_SELECT, by = Lookup.XPATH)
    SPU001_S001_SavingAccountPage selectFirstAccountNumber();

    @Select(value = STATEMENT_DISTRIBUTION_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    SPU001_S001_SavingAccountPage selectDistribution(String distribution);

    @Select(value = STATEMENT_PERIODICITY, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    SPU001_S001_SavingAccountPage selectPeriodicity(String periodicity);

    @Click(SEND_BUTTON)
    SPU001_S001_SavingAccountPageTransitions clickSend();

}
