package cz.moneta.test.dsl.ib.accountsandtransactions.pendingtransactions;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.harness.support.web.*;

public interface PendingTransactionsPage extends IbPageFlow<PendingTransactionsPage> {

    String ACCOUNT_NUMBERS_LIST = "//table[@id='helpNav']//select[@id='account']";
    String SEARCH_BUTTON = "//img[@alt='Zobrazit']";
    String RESERVATION_AMOUNT_XPATH = "//tr[@id='a1']/td/font[text()='%s']";
    String RESERVATION_DATA_XPATH = "//tr[@id='a1']/td[contains(text(),'%s')]";

    @Wait(value = ACCOUNT_NUMBERS_LIST)
    @Select(ACCOUNT_NUMBERS_LIST)
    PendingTransactionsPage selectAccountNumber(String accountNumber);

    @Wait(value = SEARCH_BUTTON)
    @Click(SEARCH_BUTTON)
    PendingTransactionsPage clickSearch();

    @CheckElementPresent(value = RESERVATION_AMOUNT_XPATH, isStringDynamicXpath = true)
    PendingTransactionsPage checkReservationAmount(String amount);

    @CheckElementPresent(value = RESERVATION_DATA_XPATH, by = Lookup.XPATH, isStringDynamicXpath = true)
    PendingTransactionsPage checkReservationDate(String date);

    @CheckElementPresent(value = RESERVATION_DATA_XPATH, isStringDynamicXpath = true)
    PendingTransactionsPage checkReservationDescription(String description);

}
