package cz.moneta.test.dsl.dmbsib;

import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Page;
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 cz.moneta.test.harness.support.web.WebFlow;

import static cz.moneta.test.dsl.dmbsib.ConfirmPaymentOrderPage.REQUESTED_DATE_SPAN;

@Wait(REQUESTED_DATE_SPAN)
public interface ConfirmPaymentOrderPage extends WebFlow<DmbsIbWebTransitions>, StoreAccessor {
    String SEND_MOBILE_KEY_BUTTON = "//button//span[contains(text(), 'Odeslat mobilní klíč')]";
    String VERIFY_MOBILE_KEY = "//button//span[contains(text(), 'Ověřit mobilní klíč')]";
    String MOBILE_KEY_INPUT = "//input[@name='smsKey']";
    String REQUESTED_DATE_SPAN = "//span[contains(text(), 'Datum splatnosti')]";

    @Click(value = SEND_MOBILE_KEY_BUTTON, andWait = @Wait(value = VERIFY_MOBILE_KEY, until = Until.VISIBLE))
    ConfirmPaymentOrderPage clickSendMobileKey();

    @TypeInto(MOBILE_KEY_INPUT)
    ConfirmPaymentOrderPage fillMobileKey(String mobileKey);

    @Click(VERIFY_MOBILE_KEY)
    @Page(ThirdPartyApplicationPageWithStatusCode.class)
    ThirdPartyApplicationPageWithStatusCode verifyMobileKeyAndContinueToSuccessPage();

}
