package cz.moneta.test.dsl.payment_engine.parts_of_menu.menu_administration;

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

import static cz.moneta.test.dsl.payment_engine.parts_of_menu.menu_administration.PaymentEngineXctRoutingTable.FIRST_BIC_ROW;
import static cz.moneta.test.dsl.payment_engine.parts_of_menu.menu_administration.PaymentEngineXctRoutingTable.FIST_ROW;

@Wait({FIST_ROW, FIRST_BIC_ROW})
public interface PaymentEngineXctRoutingTable extends WebFlow<PaymentEngineXctRoutingTable> {
    String BIC = "//input[@name='cpBankBicMask']";
    String APPLY_BUTTON = "//button[text() = 'Aplikovat']";
    String FIST_ROW = "//div[contains(@class,'x-grid3-row-selected')]";
    String FIRST_BIC_ROW = "//div[contains(@class,'x-grid3-row-selected')]//div[@class='x-grid3-cell-inner x-grid3-col-2']";
    String FIRST_BIC_ROW_VALUE = "FIRST_BIC_ROW_VALUE";

    @Wait(explicitWaitSeconds = 2)
    @TypeInto(BIC)
    @Click(value = APPLY_BUTTON, andWait = @Wait(explicitWaitSeconds = 2))
    PaymentEngineXctRoutingTable choseBicAndApply(String bic);

    @StoreElementContent(value = FIRST_BIC_ROW, storeKey = FIRST_BIC_ROW_VALUE)
    PaymentEngineXctRoutingTable saveFirsBic();

    @CheckElementPresent(FIRST_BIC_ROW)
    PaymentEngineXctRoutingTable checkBicExistence();
}
