package cz.moneta.test.dsl.newib.authentification;

import cz.moneta.test.dsl.newib.NewIbPageFlow;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.TypeInto;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.newib.authentification.AuthMobileKey.*;

@Wait(value = {MOBILE_KEY_COMPONENT_HEAD, MOBILE_KEY_INPUT, SEND_BUTTON}, waitSecondsForElement = 60)
public interface AuthMobileKey extends NewIbPageFlow<AuthMobileKey> {
    String MOBILE_KEY_COMPONENT_HEAD = "//div[(contains(text(),'Potvrďte opsáním mobilního klíče z SMS'))]";
    String MOBILE_KEY_INPUT = "//label[text()='Mobilní klíč']/following::input[@id='mobileKey']";
    String SEND_BUTTON = "//button[@data-testid='secondFactorSend' and (text()='Podepsat' or text()='Pokračovat')]";

    @TypeInto(MOBILE_KEY_INPUT)
    AuthMobileKey typeSmsKey(String smsKey);

    /* jsClick implemented because showing up banner with last users login
     Will be change to scroll and click to future or just click. */
    @Click(value = SEND_BUTTON, jsClick = true)
    AuthMobileKeyTransitions clickSend();
}
