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

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.Until;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.hypos.pages.contract.approvalchecklist.ChecklistAddDocTypeModalPage.PAGE_TITLE;

@Wait(PAGE_TITLE)
public interface ChecklistAddDocTypeModalPage extends HyposPageFlow<ChecklistAddDocTypeModalPage>, Menu {
    String MODAL_XPATH = "//div[@id=\"simplemodal-container\"]";
    String PAGE_TITLE = MODAL_XPATH + "//h2[text()='Přidání požadovaného dokumentu']";
    String REQUESTED_DOC_FIELD = MODAL_XPATH + "//input[@type='text']";
    String UW_EXCEPTION_DOC_TYPE = MODAL_XPATH + "//a[text()='Výjimka']";
    String SAVE_BUTTON = MODAL_XPATH + "//button[text()='Uložit']";

    @TypeInto(REQUESTED_DOC_FIELD)
    ChecklistAddDocTypeModalPage fillRequestedDoc (String requestedChecklistDoc);

    @Click(UW_EXCEPTION_DOC_TYPE)
    ChecklistAddDocTypeModalPage selectUwExceptionDocType();

    @Click(value = SAVE_BUTTON, andWait = @Wait(value = ApprovalChecklistPage.PAGE_TITLE, until = Until.VISIBLE))
    ApprovalChecklistPage saveModalPage();
}