package cz.moneta.test.dsl.ufo.operations.client.clientDetail;

import cz.moneta.test.dsl.ufo.operations.shared.topmenu.XXX702_SharedTopMenu;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.operations.client.clientDetail.STS701_S002_AdcProductsPanel.ADC_PRODUCT;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = ADC_PRODUCT)
@Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE)
public interface STS701_S002_AdcProductsPanel extends XXX702_SharedTopMenu<STS701_S002_AdcProductsPanel>, STS701_S002_InfoServiceExpressSettings, STS701_S002_InfoServiceOrderDetail, STS701_S002_InfoServiceOrdersList {
    String ADC_PRODUCT = "STS701_S002_C018";
    String CANCEL_INTERNET_BANK_BUTTON = "STS701_S002_B048";
    String CANCEL_BANK_CLIENT_BUTTON = "STS701_S002_B060";
    String FIRST_CANCEL_SMART_BANK_XPATH = "(//img[contains(@id, 'STS701_S002_P005') and not(contains(@style,'display: none;'))])[1]";
    String FIRST_SMART_BANK_CHECKBOX = FIRST_CANCEL_SMART_BANK_XPATH + "/../../..//input";

    @Click(CANCEL_INTERNET_BANK_BUTTON)
    @AcceptAlert(waitSecondsForAlert = 5)
    STS701_S002_ClientDetailPage clickCancelInternetBank();

    @Click(CANCEL_BANK_CLIENT_BUTTON)
    @AcceptAlert(waitSecondsForAlert = 5)
    STS701_S002_ClientDetailPage clickCancelBankClient();

    @AcceptAlert(waitSecondsForAlert = 10)
    STS701_S002_ClientDetailPage acceptAlert();

    @Click(value = FIRST_CANCEL_SMART_BANK_XPATH, by = Lookup.XPATH, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    STS701_S002_AdcProductsPanel clickFirstCancelSmartBank();

    @Click(value = FIRST_SMART_BANK_CHECKBOX, by = Lookup.XPATH)
    STS701_S002_AdcProductsPanel clickFirstSmartBank();

    @CheckElementContent(STATUS_BAR)
    STS701_S002_AdcProductsPanel checkStatusMessage(String expectedStatusMessage);
}