package cz.moneta.test.dsl.ib.authentication;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.harness.endpoints.WebEndpoint;
import cz.moneta.test.harness.support.web.Click;

public interface AuthChoicePage extends IbPageFlow<AuthChoicePage>, AuthChoicePageTransitions {

    String AUTHENTICATE_WITH_PASSWORD_BUTTON = "//div[@id='document']//img[contains(@src, 'prihlasitseheslem_b.gif')]";
    String AUTHENTICATE_WITH_MOBILE_KEY_BUTTON = "//button[@id='typeMobileKey']";
    String AUTHENTICATE_WITH_CERTIFICATE_BUTTON = "//div[@id='document']//img[contains(@src, 'prihlasitsecertifikatem_b.gif')]";
    String AUTHENTICATE_TO_BANKA_MINI = "//div[@id='document']//img[contains(@src, 'pristup-do-evypisu_b.gif')]";

    default void loadPage(WebEndpoint endpoint) {
        endpoint.waitForAnyElementToLoad(20,
                AUTHENTICATE_WITH_PASSWORD_BUTTON,
                AUTHENTICATE_WITH_MOBILE_KEY_BUTTON,
                AUTHENTICATE_WITH_CERTIFICATE_BUTTON,
                AUTHENTICATE_TO_BANKA_MINI);
    }

    @Click(AUTHENTICATE_WITH_MOBILE_KEY_BUTTON)
    AuthMobileKeyPage chooseAuthenticationWithMobileKey();
    @Click(AUTHENTICATE_WITH_PASSWORD_BUTTON)
    AuthChoicePageTransitions chooseAuthenticationWithPasswordOnly();
}