package cz.moneta.test.dsl.exevido.pages;

import cz.moneta.test.dsl.exevido.ExevidoWebFlow;
import cz.moneta.test.dsl.exevido.components.ExevidoPanels;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.exevido.pages.DetailIncomingMessagePage.PAGE_LABEL;

@Wait(value = PAGE_LABEL)
public interface DetailOutgoingMessagePage extends ExevidoWebFlow<DetailOutgoingMessagePage> {

    String PAGE_LABEL = "outgoing_message_label";
    String SEND_REPLY_BUTTON_XPATH = "//button[@title='Vytvoří ke zprávě odpověď a odešle']";
    String RETURN_TO_PROCESSING_BUTTON_XPATH = "//button[@title='Vrátí zprávu ke zpracování']";
    String FOR_CHECK_REASON_INPUT = "forCheckReason";
    String ADD_FOR_REASON_BUTTON = "addForReasonButton";

    @Click(value = SEND_REPLY_BUTTON_XPATH, by = Lookup.XPATH, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
    IncomingMessagesPage clickSendReply();

    @Click(value = RETURN_TO_PROCESSING_BUTTON_XPATH, by = Lookup.XPATH, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
    DetailOutgoingMessagePage clickReturnToProcessing();

    @TypeInto(FOR_CHECK_REASON_INPUT)
    DetailOutgoingMessagePage fillReason(String reason);

    @Click(value = ADD_FOR_REASON_BUTTON, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
    IncomingMessagesPage clickAddReason();

}