package cz.moneta.test.dsl.ufo.cb.landing;

import cz.moneta.test.dsl.ufo.operations.shared.SharedElements;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.support.web.*;

@Wait(value = KOM402_S001_ProposalSignpost.DELETE_PROPOSAL, until = Until.VISIBLE)
public interface KOM402_S001_ProposalSignpost extends WebFlow<KOM402_S001_ProposalSignpost>, StoreAccessor {
    String DELETE_PROPOSAL = "KOM402_S001_B031";
    String ALERT_TEXT = "Chystáte se nenávratně zrušit rozpracovaný návrh! Opravdu chcete pokračovat? (OK - Ano, Cancel - Ne)";
    String PROPOSAL_PART_XPATH = "//table[@id='KOM402_S001_G001_UfoTable']//td[text()='%s']";

    @Click(value = PROPOSAL_PART_XPATH, isStringDynamicXpath = true, by = Lookup.XPATH, andWait = @Wait(value = SharedElements.LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    KOM401_S001_ProposalParameters clickProposalPart(String proposalPart);

    @Click(DELETE_PROPOSAL)
    @AcceptAlert(waitSecondsForAlert = 2, expectedAlertText = ALERT_TEXT)
    UKO401_S004_DeleteWarning clickDeleteAndConfirm();

}
