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

import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Select;
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.hypokalkulacka.HypokalkulackaRealtyPage.SAVE_REALTY_BUTTON_XPATH;

@Wait(value = SAVE_REALTY_BUTTON_XPATH, until = Until.VISIBLE)
public interface HypokalkulackaRealtyPage extends HyposPageFlow<HypokalkulackaRealtyPage> {
    String REALTY_INPUT_DIV = "//div[@id='realty-input']";
    String REALTY_TYPE_SELECT = REALTY_INPUT_DIV + "//select[@id='realty-type']";
    String REALTY_PRICE_INPUT = REALTY_INPUT_DIV + "//input[@id='realty-price']";
    String REALTY_CONTRACT_SELECT = REALTY_INPUT_DIV + "//select[@id='realty-contract-relation']";
    String SAVE_REALTY_BUTTON_XPATH = REALTY_INPUT_DIV + "//input[@value='Uložit']";

    @Select(REALTY_TYPE_SELECT)
    HypokalkulackaRealtyPage selectRealtyType(String realtyType);

    @TypeInto(value = REALTY_PRICE_INPUT, clear = true)
    HypokalkulackaRealtyPage fillRealtyPrice(int price);

    @Select(REALTY_CONTRACT_SELECT)
    HypokalkulackaRealtyPage selectContractRealtion(String contractRelation);

    @Click(SAVE_REALTY_BUTTON_XPATH)
    HypokalkulackaPage clickSaveRealtyButton();
}