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

import cz.moneta.test.dsl.hypos.components.Menu;
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.support.web.AcceptAlert;
import cz.moneta.test.harness.support.web.CheckElementPresent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.hypos.pages.contract.approval.CancelContractPage.CANCEL_CONTRACT_BY_CLIENT_CHECKBOX;

@Wait(CANCEL_CONTRACT_BY_CLIENT_CHECKBOX)
public interface CancelContractPage extends HyposPageFlow<CancelContractPage>, StoreAccessor, Menu {
    String CANCEL_CONTRACT_BUTTON = "//input[@id='cancel-contract']";
    String CANCEL_CONTRACT_BY_CLIENT_CHECKBOX = "//input[@id='stt_obchod_zrusen_ze_strany_klienta']";
    String CANCEL_CONTRACT_SUCCESS_TEXT = "//h2[text()='Došlo k úspěšnému ukončení obchodu']";

    @Click(CANCEL_CONTRACT_BY_CLIENT_CHECKBOX)
    CancelContractPage clickCancelContractByClientCheckbox();

    @Click(CANCEL_CONTRACT_BUTTON)
    @AcceptAlert(waitSecondsForAlert = 10)
    CancelContractPage clickCancelContractButton();

    @CheckElementPresent(CANCEL_CONTRACT_SUCCESS_TEXT)
    CancelContractPage checkCancelContractSuccessText();
}