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

import cz.moneta.test.dsl.ufo.cb.landing.proposals.Proposal;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.endpoints.ufo.UfoEndpoint;
import cz.moneta.test.harness.support.web.*;

@Wait(value = KOM480_S001_DealProposal.OK_BUTTON, until = Until.VISIBLE)
public interface KOM480_S001_DealProposal extends WebFlow<KOM480_S001_DealProposal>, StoreAccessor {
    String PROPOSAL_ID = "KOM480_S001_L001";
    String OK_BUTTON = "KOM480_S001_B001";

    @Click(OK_BUTTON)
    KOM402_S001_ProposalSignpost clickOkButton();

    @CustomAction
    default KOM480_S001_DealProposal saveProposalId(Proposal proposal) {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        proposal.setProposalId(endpoint.getText(PROPOSAL_ID));
        return null;
    }

}
