package cz.moneta.test.dsl.ufo.operations.ufoOperations;

import cz.moneta.test.dsl.ufo.operations.client.clientDetail.STS701_S002_ClientDetailPage;
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.ufoOperations.OPK745_S001_TransactionSettings.PAGE_TOPIC;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(PAGE_TOPIC)
public interface OPK745_S001_TransactionSettings extends WebFlow<OPK745_S001_TransactionSettings>, XXX702_SharedTopMenu<OPK745_S001_TransactionSettings> {

    String PAGE_TOPIC = "OPK745_S001_L001";
    String INTERNET_TRANSACTIONS_OFF_RADIOBOX = "OPK745_S001_R002_0";
    String INTERNET_TRANSACTIONS_ON_RADIOBOX = "OPK745_S001_R002_1";
    String SAVE_SETTINGS_BUTTON = "OPK745_S001_B003";

    @Click(INTERNET_TRANSACTIONS_OFF_RADIOBOX)
    @AcceptAlert(waitSecondsForAlert = 5, expectedAlertText = "Informujte klienta, že změna automaticky ovlivní internetové i MO/TO platby")
    OPK745_S001_TransactionSettings clickInternetTransactionsOff();

    @Click(INTERNET_TRANSACTIONS_ON_RADIOBOX)
    @AcceptAlert(waitSecondsForAlert = 5, expectedAlertText = "Informujte klienta, že změna automaticky ovlivní internetové i MO/TO platby")
    OPK745_S001_TransactionSettings clickInternetTransactionsOn();

    @Click(value = SAVE_SETTINGS_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    STS701_S002_ClientDetailPage clickSaveSettings();

    @Click(value = SAVE_SETTINGS_BUTTON)
    @AcceptAlert(waitSecondsForAlert = 1, expectedAlertText = "U této aktivní operace je nutné klienta ověřit přes SB. Klienta ověřte.")
    OPK745_S001_TransactionSettings clickSaveWithExpectedInfoError();
}
