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

import cz.moneta.test.dsl.hypos.components.Menu;
import cz.moneta.test.dsl.hypos.enums.CollectableFee;
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.hypos.pages.contract.fees.FeesPage.PAGE_TITLE;
import static cz.moneta.test.dsl.hypos.pages.contract.fees.FeesPage.COLLECTABLE_FEE_SELECT;

@Wait({PAGE_TITLE, COLLECTABLE_FEE_SELECT})
public interface FeesPage extends HyposPageFlow<FeesPage>, Menu {
    String PAGE_TITLE = "//h1[text()='Poplatky']";
    String COLLECTABLE_FEE_SELECT = "//select[@id='collectable-fee']";
    String CASH_BUTTON = "//input[@value='INKASOVAT']";
    String COLLECTED_FEE_TEXT = "//h3[contains(text(),'Byl zinkasován poplatek')]";

    @Select(COLLECTABLE_FEE_SELECT)
    FeesPage selectCollectableFee(CollectableFee fee);

    @Click(value = CASH_BUTTON, andWait = @Wait(value = COLLECTED_FEE_TEXT, until = Until.VISIBLE))
    FeesPage clickCash();

    @CheckElementPresent(COLLECTED_FEE_TEXT)
    FeesPage checkCollectedFee();
}