package cz.moneta.test.dsl.ufo.banka.pages.products.current.account;

import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.products.current.account.BUF001_S001_CurrentAccountPage.BUF001_S001_PAGE_LABEL_XPATH;
import static cz.moneta.test.dsl.ufo.banka.pages.products.current.account.BUF001_S001_CurrentAccountPage.CONFIRM_BUTTON;
import static cz.moneta.test.dsl.ufo.banka.pages.products.current.account.BUF001_S001_CurrentAccountPage.FEE_PLAN_SELECT;
import static cz.moneta.test.dsl.ufo.banka.pages.products.current.account.BUF001_S001_CurrentAccountPage.PAGE_ID;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = BUF001_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
@Wait(value = FEE_PLAN_SELECT, until = Until.CLICKABLE)
@Wait({PAGE_ID, CONFIRM_BUTTON})
public interface BUF001_S001_CurrentAccountPage extends WebFlow<BUF001_S001_CurrentAccountPage> {
    String BUF001_S001_PAGE_LABEL_XPATH = "//div[text()='BUF001_S001']";
    String PAGE_ID = "XXX001_T001_W001";
    String CONFIRM_BUTTON = "BUF001_S001_B001";
    String FEE_PLAN_SELECT = "BUF001_S001_C006";
    String DISTRIBUTION_TYPE_SELECT = "BUF001_S001_C003";
    String PRODUCT_SELECT = "BUF001_S001_C001";
    String DISPOSITION_RADIO_YES = "BUF001_S001_R003_1";
    String DISPOSITION_RADIO_NO = "BUF001_S001_R003_0";

    @Select(FEE_PLAN_SELECT)
    BUF001_S001_CurrentAccountPage selectFeePlan(String text);

    @Select(value = FEE_PLAN_SELECT, selectByOrder = true)
    BUF001_S001_CurrentAccountPage selectFeePlanByOrder(int accountOrder);

    @Select(value = PRODUCT_SELECT, andWait = @Wait(explicitWaitSeconds = 2))
    BUF001_S001_CurrentAccountPage selectProduct(String text);

    @Select(value = DISTRIBUTION_TYPE_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    BUF001_S001_CurrentAccountPage selectDistributionType(String distribution);

    @Click(DISPOSITION_RADIO_YES)
    BUF001_S001_CurrentAccountPage clickDispositionRadioYes();

    @Click(DISPOSITION_RADIO_NO)
    BUF001_S001_CurrentAccountPage clickDispositionRadioNo();

    @Click(CONFIRM_BUTTON)
    BUF001_S001_CurrentAccountPageTransitions clickConfirm();

}
