package cz.moneta.test.dsl.ufo.banka.pages.products.one.click;

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

import static cz.moneta.test.dsl.ufo.banka.pages.products.one.click.BAL031_S001_OneClickRetailPage.PAGE_LABEL_XPATH;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

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

    String CONTINUE_BUTTON = "BAL031_S001_B003";
    String PRODUCT_TYPE_SELECT = "BAL031_S001_C001";
    String CARD_TYPE_SELECT = "BAL031_S001_C007";
    String CARD_PLASTIC_RADIO = "BAL031_S001_R009_1";
    String CARD_DESIGN_SELECT = "BAL031_S001_C005";
    String PRODUCT_MEDIATED_BY_ADVISOR_NO_RADIO = "BAL031_S001_R001_0";
    String DISPOSITION_RIGHTS_YES_RADIO = "BAL031_S001_R005_1";
    String DISPOSITION_RIGHTS_SA_YES_RADIO = "BAL031_S001_R006_1";
    String SA_STATEMENTS_END_OF_MONTH_NO_RADIO = "BAL031_S001_R004_0";
    String SA_NAME_INPUT = "BAL031_S001_E013";
    String DISPONENTS_ONLY_OWNER_RADIO = "BAL031_S001_R003_0";
    String DISPOSITION_RIGHTS_NO_RADIO = "BAL031_S001_R005_0";
    String NO_INTERNET_BANK_CHECKBOX = "BAL031_S001_H005_1";
    String DISTRIBUTION_FOR_ACCOUNT_SELECT = "BAL031_S001_C002";
    String DISTRIBUTION_FOR_SAVING_ACCOUNT_SELECT = "BAL031_S001_C004";

    @Select(value = PRODUCT_TYPE_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    BAL031_S001_OneClickRetailPage selectProductType(String productType);

    @Select(value = CARD_TYPE_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    BAL031_S001_OneClickRetailPage selectCardType(String productType);

    @Click(value = CARD_PLASTIC_RADIO, jsClick = true, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    BAL031_S001_OneClickRetailPage clickPlasticCard();

    @Wait(value = CARD_DESIGN_SELECT, until = Until.CLICKABLE, waitSecondsForElement = 60)
    @Select(value = CARD_DESIGN_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    BAL031_S001_OneClickRetailPage selectCardDesign(String cardDesign);

    @Click(CONTINUE_BUTTON)
    BAL031_S001_OneClickPageRetailTransitions clickContinue();

    @Click(value = PRODUCT_MEDIATED_BY_ADVISOR_NO_RADIO, jsClick = true, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    BAL031_S001_OneClickRetailPage clickNoProductMediatedByAdvisor();

    @Click(value = DISPOSITION_RIGHTS_NO_RADIO, jsClick = true, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    BAL031_S001_OneClickRetailPage clickNoDispositionRights();

    @Click(value = DISPOSITION_RIGHTS_YES_RADIO, jsClick = true)
    BAL031_S001_OneClickRetailPage clickYesDispositionRights();

    @Click(value = DISPONENTS_ONLY_OWNER_RADIO, jsClick = true)
    BAL031_S001_OneClickRetailPage clickYesDisponentsOnlyOwner();

    @Click(value = DISPOSITION_RIGHTS_SA_YES_RADIO, jsClick = true)
    BAL031_S001_OneClickRetailPage clickYesDispositionRightsForSA();

    @Click(value = SA_STATEMENTS_END_OF_MONTH_NO_RADIO, jsClick = true, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    BAL031_S001_OneClickRetailPage clickNoSaStatementsEndOfMonth();

    @TypeInto(value = SA_NAME_INPUT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    BAL031_S001_OneClickRetailPage typeSaName(String saName);

    @Click(value = NO_INTERNET_BANK_CHECKBOX, jsClick = true, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    BAL031_S001_OneClickRetailPage clickNoIB();

    @Select(value = DISTRIBUTION_FOR_ACCOUNT_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    BAL031_S001_OneClickRetailPage selectDistributionAccount(String distribution);

    @Select(value = DISTRIBUTION_FOR_SAVING_ACCOUNT_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    BAL031_S001_OneClickRetailPage selectDistributionForSavingAccount(String distribution);
}
