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

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.SearchContractPage.CONTRACT_CODE_INPUT;
import static cz.moneta.test.dsl.hypos.pages.contract.SearchContractPage.PAGE_TITLE;
import static cz.moneta.test.dsl.hypos.pages.contract.SearchContractPage.SEARCH_CONTRACT_BUTTON;

@Wait({PAGE_TITLE, CONTRACT_CODE_INPUT, SEARCH_CONTRACT_BUTTON})
public interface SearchContractPage extends HyposPageFlow<SearchContractPage> {
    String PAGE_TITLE = "//h1[text()='Vyhledání obchodu']";
    String SEARCH_FORM = "//form[@class='uiForm']";
    String CONTRACT_CODE_INPUT = SEARCH_FORM + "//input[@id='contractCode']";
    String SEARCH_CONTRACT_BUTTON = SEARCH_FORM + "//input[@value='Vyhledat']";

    @TypeInto(CONTRACT_CODE_INPUT)
    SearchContractPage fillContractId(String contractId);

    @Click(SEARCH_CONTRACT_BUTTON)
    EditContinuePage clickSearchcontractButton();
}
