package cz.moneta.test.dsl.ufo.banka.pages.products.current.account.transasctional;

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

import static cz.moneta.test.dsl.ufo.banka.pages.products.current.account.transasctional.PKU005_S010_PostedTransactionsPage.POSTED_TRANSACTIONS_PAGE_ID;
import static cz.moneta.test.dsl.ufo.banka.pages.products.current.account.transasctional.PKU005_S010_PostedTransactionsPage.TYPE_OF_TRANSACTIONS;

@Wait(value = {POSTED_TRANSACTIONS_PAGE_ID, TYPE_OF_TRANSACTIONS}, waitSecondsForElement = 30)
public interface PKU005_S010_PostedTransactionsPage extends WebFlow<PKU005_S010_PostedTransactionsPage> {
    String POSTED_TRANSACTIONS_PAGE_ID = "XXX001_T001_L005";
    String TYPE_OF_TRANSACTIONS = "PKU005_S010_C001";
    String LOAD_FILTER_BUTTON = "PKU005_S010_B001";
    String FIRST_DETAIL_BUTTON = "PKU005_S010_G001-0";
    String INPUT_VALUE_FROM = "PKU005_S010_E003";
    String INPUT_VALUE_TO = "PKU005_S010_E004";
    String DATE_OF_ACCOUNTED = "//th[contains(text(),'Datum zúčtování')]";

    @Select(TYPE_OF_TRANSACTIONS)
    PKU005_S010_PostedTransactionsPage selectTypeOfTransactions(String typeOfTransactions);

    @TypeInto(INPUT_VALUE_FROM)
    PKU005_S010_PostedTransactionsPage setValueFrom(String transactionFrom);

    @TypeInto(INPUT_VALUE_TO)
    PKU005_S010_PostedTransactionsPage setValueTo(String transactionTo);

    @Click(value = LOAD_FILTER_BUTTON, andWait = @Wait(value = FIRST_DETAIL_BUTTON, until = Until.VISIBLE))
    PKU005_S010_PostedTransactionsPage clickToLoadFilter();

    @Click(value = FIRST_DETAIL_BUTTON)
    PKU005_S003_DetailPostedTransactionPage clickDetailToFirstTransaction();

    @Clicks({
            @Click(value = DATE_OF_ACCOUNTED, by = Lookup.XPATH),
            @Click(value = DATE_OF_ACCOUNTED, by = Lookup.XPATH)})
    PKU005_S010_PostedTransactionsPage sortFromLastTransaction();

}