package cz.moneta.test.dsl.hypos.pages.contract.communication;

import cz.moneta.test.dsl.hypos.components.Menu;
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.TypeInto;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.hypos.pages.contract.communication.CommunicationPage.PAGE_TITLE;

@Wait(PAGE_TITLE)
public interface CommunicationPage extends HyposPageFlow<CommunicationPage>, Menu {
    String PAGE_TITLE = "//h1[text()='Sdělení']";
    String NEW_COMMUNICATION = "//h2[text()='Nové sdělení']";
    String COMMUNICATION_TEXT_FIELD = "//textarea[@name='memoText']";
    String SAVE_COMMUNICATION_TEXT_FIELD = "//form[@class='uiForm']//input[@value='Uložit']";

    @Click(NEW_COMMUNICATION)
    CommunicationPage openNewCommunication();

    @TypeInto(COMMUNICATION_TEXT_FIELD)
    CommunicationPage addNewCommunication(String communicationMessage);

    @Click(SAVE_COMMUNICATION_TEXT_FIELD)
    CommunicationPage saveNewCommunication();
}