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.*;
import static cz.moneta.test.dsl.payment_engine.parts_of_menu.menu_transaction.PaymentEngineManualCreateSCTClaimNonReciept.PAYMENT_ID_INPUT;

@Wait(value = PAYMENT_ID_INPUT, waitSecondsForElement = 100)
public interface PaymentEngineManualCreateSCTClaimNonReciept extends WebFlow<PaymentEngineManualCreateSCTClaimNonReciept> {

    String PAYMENT_ID_INPUT = "//input[@name='tranIdPredecessor']";
    String AGENT_INSTRUCTION_INPUT = "//input[@name='cpAgentInstr']";
    String OK_BUTTON = "//button[text()='OK']";
    String TRANSACTION_ID_KEY = "TRANSACTION_ID_KEY";
    String TRANSACTION_ID_XPATH = "//div[@class='ext-mb-content']/span[@class='ext-mb-text']";
    String NO_BUTTON = "//button[text()='Ne']";

    @TypeIntos({@TypeInto(PAYMENT_ID_INPUT), @TypeInto(AGENT_INSTRUCTION_INPUT)})
    PaymentEngineManualCreateSCTClaimNonReciept fillSCTData(String transactionId, String instruction);

    @Click(value = OK_BUTTON, andWait = @Wait(value = TRANSACTION_ID_XPATH, until = Until.VISIBLE))
    PaymentEngineManualCreateSCTClaimNonReciept clickOk();

    @StoreElementContent(storeKey = TRANSACTION_ID_KEY, value = TRANSACTION_ID_XPATH)
    PaymentEngineManualCreateSCTClaimNonReciept storeRequestId();

    @Click(value = NO_BUTTON, andWait = @Wait(value = NO_BUTTON, until = Until.GONE))
    PaymentEngineHomePage clickNo();

}