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.Click;
import cz.moneta.test.harness.support.web.Lookup;
import cz.moneta.test.harness.support.web.Until;
import cz.moneta.test.harness.support.web.Wait;

@Wait(value = CardsOnboardingDocumentPage.CARDS_ONBOARDING_DOCUMENTS_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
public interface CardsOnboardingDocumentPage extends NewIbPageFlow<CardsOnboardingDocumentPage>, VerticalMainMenu {
    String CARDS_ONBOARDING_DOCUMENTS_XPATH = "//h1[@class='t-title t-title--h4 u-mb--xxLarge'][text()='Před podpisem smlouvy si přečtěte tyto dokumenty']";
    String UNDERSTAND_AND_AGREE_BUTTON_XPATH = "//button[text()='Rozumím a souhlasím']";
    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)
    CardsOnboardingDocumentPage waitForLoader();

    @Click(value = UNDERSTAND_AND_AGREE_BUTTON_XPATH, andWait = @Wait(value = SIGN_BUTTON_XPATH, until = Until.VISIBLE, by = Lookup.XPATH))
    CardsOnboardingContractPage clickUnderstandAndAgreeButton();
}
