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

import cz.moneta.test.dsl.payment_engine.home.PaymentEngineHomePage;
import cz.moneta.test.harness.support.web.*;

public interface PaymentEngineOutgoingArchiv extends WebFlow<PaymentEngineOutgoingArchiv> {

    String AJAX_LOADING = "//div[text()='Načítám...']";
    String SEARCH_FIELD = "//input[@name='field1#id']";
    String SEARCH_BTN = "//button[@class='x-btn-text'][text() = 'Hledat']";
    String SELECT_TRANSACTION = "//div[contains(@class,'x-grid3-row')]//div[@class='x-grid3-cell-inner x-grid3-col-2'][text() = '%s']";
    String MANUAL_ACTIONS = "//a[text()= 'Manuální akce']";
    String CLOSE_TAB_BUTTON = "//a[@class='x-tab-strip-close']";

    @Wait(value = SEARCH_FIELD, until = Until.VISIBLE)
    @TypeInto(SEARCH_FIELD)
    PaymentEngineOutgoingArchiv fillId(String transactionId);

    @Click(value = SEARCH_BTN, andWait = @Wait(value = AJAX_LOADING, until = Until.GONE))
    PaymentEngineOutgoingArchiv searchUnverified();

    @Click(value = SELECT_TRANSACTION, isStringDynamicXpath = true, andWait = @Wait(explicitWaitSeconds = 1))
    PaymentEngineOutgoingArchiv selectTransaction(String transactionId);

    @Click(value = MANUAL_ACTIONS, andWait = @Wait(value = MANUAL_ACTIONS, until = Until.GONE))
    PaymentEngineOutgoingArchivEdit clickOnManualActions();

    @Click(CLOSE_TAB_BUTTON)
    PaymentEngineHomePage closeTab();

}
