package cz.moneta.test.dsl.ib.insurance.exhaustedAmount;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.dsl.ib.components.MainMenu;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ib.insurance.exhaustedAmount.ExhaustedAmountInputPage.FIRST_STEP_IN_PROGRESS;
import static cz.moneta.test.dsl.ib.insurance.exhaustedAmount.ExhaustedAmountInputPage.PAGE_NAME_XPATH;

@Wait({PAGE_NAME_XPATH, FIRST_STEP_IN_PROGRESS})
public interface ExhaustedAmountInputPage extends IbPageFlow<ExhaustedAmountInputPage>, MainMenu {
    String PAGE_NAME_XPATH = "//div[contains(text(),'Aktivace pojištění vyčerpané částky ke kreditní kartě')]";
    String FIRST_STEP_IN_PROGRESS = "//img[@src='images_new/top_step2_1.gif']";
    String INFORMATION_MATERIAL_TO_INSURANCE_PROGRAM_CHECKBOX = "//tr[@id='_tr_insuranceAccept1']//input[@type='checkbox' and @name='insuranceAccept1']";
    String INFORMATION_MATERIAL_TO_INSURANCE_PROGRAM_LINK = "//tr[@id='_tr_insuranceAccept1']//a[@href='https://www.moneta.cz/documents/cz/informacni-brozura-pojisteni-vycerpane-castky.pdf' and contains(text(),'informačního materiálu k pojistnému programu \"Pojištění vyčerpané částky\"')]";
    String AGREEMENT_INSURANCE_CHECKBOX = "//tr[@id='_tr_insuranceAccept2']//input[@name='insuranceAccept2']";
    String AGREEMENT_INSURANCE_LINK = "//tr[@id='_tr_insuranceAccept2']//a[text()='souhlasu s pojištěním']";
    String CONTINUE_BUTTON = "//img[@alt='Pokračovat']";
    String MOBILE_KEY_TEXT = "//tr[@id='_tr_SMSCode']/td[contains(text(), 'Mobilní klíč')]";
    String MOBILE_KEY_INPUT = "//tr[@id='_tr_SMSCode']//input[@id='SMSCode']";
    String SIGN_BUTTON = "//a[@id='sendBtn']";

    @CheckElementPresent(INFORMATION_MATERIAL_TO_INSURANCE_PROGRAM_LINK)
    @Click(INFORMATION_MATERIAL_TO_INSURANCE_PROGRAM_CHECKBOX)
    ExhaustedAmountInputPage clickCheckToInformationMaterial();

    @CheckElementPresent(AGREEMENT_INSURANCE_LINK)
    @Click(AGREEMENT_INSURANCE_CHECKBOX)
    ExhaustedAmountInputPage clickAgreementWithInsurance();

    @Click(CONTINUE_BUTTON)
    ExhaustedAmountInputPage clickCountinueButton();

    @CheckElementPresent(MOBILE_KEY_TEXT)
    @TypeInto(MOBILE_KEY_INPUT)
    ExhaustedAmountInputPage fillInMobileKey(String mobileKey);

    @Click(SIGN_BUTTON)
    ExhaustedAmountInputPage clickSignButton();
}