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

import cz.moneta.test.dsl.newib.NewIbPageFlow;
import cz.moneta.test.dsl.newib.components.VerticalMainMenu;
import cz.moneta.test.harness.support.web.*;

@Wait(value = CardsOnboardingContractPage.CARDS_ONBOARDING_CONTRACT_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
public interface CardsOnboardingContractPage extends NewIbPageFlow<CardsOnboardingContractPage>, VerticalMainMenu {

    String CARDS_ONBOARDING_CONTRACT_XPATH = "//h1[@class='t-title t-title--h4 u-mb--xxLarge'][text()='Pro zaslání karty potřebujeme Váš souhlas']";
    String SIGN_BUTTON_XPATH = "//button[text()='Podepsat']";
    String MOBILE_KEY_INPUT = "//label[text()='Mobilní klíč']/following::input[@id='mobileKey']";
    String LOADER_IMG_XPATH = "//*[@class='c-loader__image']";

    @Wait(value = LOADER_IMG_XPATH, waitSecondsForElement = 60, by = Lookup.XPATH, until = Until.GONE)
    CardsOnboardingContractPage waitForLoader();

    @Click(SIGN_BUTTON_XPATH)
    CardsOnboardingContractPage clickSign();

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

    @Click(SIGN_BUTTON_XPATH)
    CardsOnboardingFinalPage clickSignToFinalPage();
}
