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

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.dsl.ib.components.MainMenu;
import cz.moneta.test.dsl.ib.insurance.paymentsandexpenses.PaymentsAndExpensesCreatePage;
import cz.moneta.test.dsl.ib.insurance.accident.AccidentInsuranceCreatePage;
import cz.moneta.test.dsl.ib.insurance.electronicpayment.ElectronicPaymentInsuranceCreatePage;
import cz.moneta.test.dsl.ib.insurance.exhaustedAmount.ExhaustedAmountInputPage;
import cz.moneta.test.dsl.ib.insurance.insuranceofproperty.InsuranceOfPropertyCardsAndInternetRisksCreatePage;
import cz.moneta.test.dsl.ib.insurance.travel.LongTermTravelInsuranceCreatePage;
import cz.moneta.test.dsl.ib.insurance.travel.ShortTermTravelInsuranceCreatePage;
import cz.moneta.test.harness.support.web.CheckElementContent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

public interface InsurancePage extends IbPageFlow<InsurancePage>, MainMenu {

    String SHORT_TERM_INSURANCE_CREATE_BUTTON = "//a[contains(@href, 'STTI')]";
    String ACCIDENT_INSURANCE_CREATE_BUTTON = "//a[contains(@href, 'ACCIDENT')]";
    String INSURANCE_OF_PROPERTY_CARDS_AND_INTERNET_RISKS_CREATE_BUTTON = "//a[contains(@href, '7733001')]";
    String ELECTRONIC_PAYMENT_INSURANCE_CREATE_BUTTON = "//a[contains(@href, '7734001')]";
    String INSURANCE_TABLE  = "//table[@id='insuranceList_16_1']";
    String LONG_TERM_INSURANCE_CREATE_BUTTON = "//a[contains(@href, 'LTTI')]";
    String LONG_TERM_EUROPE_SINGLE_INSURANCE = "//td[contains(text(), 'Dlouhodobé cestovní pojištění Evropa (single)')]";
    String LONG_TERM_EUROPE_FAMILY_INSURANCE = "//td[contains(text(), 'Dlouhodobé cestovní pojištění Evropa (family)')]";
    String LONG_TERM_WORLD_SINGLE_INSURANCE = "//td[contains(text(), 'Dlouhodobé cestovní pojištění Svět (single)')]";
    String LONG_TERM_WORLD_FAMILY_INSURANCE = "//td[contains(text(), 'Dlouhodobé cestovní pojištění Svět (family)')]";
    String ELECTRONIC_PAYMENT_INSURANCE_CHECK = "//td[contains(text(), 'Pojištění elektronických plateb')]";
    String PAYMENTS_AND_EXPENSES_INSURANCE_CREATE_BUTTON = "//a[contains(@href, '7701002')]";
    String PAYMENTS_AND_EXPENSES_INSURANCE_CHECK = "//td[contains(text(), 'Pojištění splátek a výdajů')]";
    String PROPERTY_CARDS_AND_INTERNET_RISK_INSURANCE_CHECK = "//td[contains(text(), 'Pojištění osobních věcí, platebních karet a internetových rizik')]";
    String ACCIDENT_ADULT_INSURANCE_CHECK = "//td[contains(text(), 'Úrazové pojištění - varianta Dospělý')]";
    String ACCIDENT_FAMILY_INSURANCE_CHECK = "//td[contains(text(), 'Úrazové pojištění - varianta Family')]";
    String ACCIDENT_JUNIOR_INSURANCE_CHECK = "//td[contains(text(), 'Úrazové pojištění - varianta Junior')]";
    String SHORT_TERM_EUROPE_SINGLE_INSURANCE = "//td[contains(text(), 'Krátkodobé cestovní pojištění Evropa single')]";
    String SHORT_TERM_EUROPE_FAMILY_INSURANCE = "//td[contains(text(), 'Krátkodobé cestovní pojištění Evropa family')]";
    String SHORT_TERM_WORLD_SINGLE_INSURANCE = "//td[contains(text(), 'Krátkodobé cestovní pojištění Svět single')]";
    String SHORT_TERM_WORLD_FAMILY_INSURANCE = "//td[contains(text(), 'Krátkodobé cestovní pojištění Svět family')]";
    String EXHAUSTED_AMOUNT_INSURANCE_BUTTON = "//img[@src='images_new/banners/insurance/pojisteniVycerpaneCastky.png']/following::div[@class='button']";

    @Click(SHORT_TERM_INSURANCE_CREATE_BUTTON)
    ShortTermTravelInsuranceCreatePage clickCreateShortTermInsurance();

    @Click(ACCIDENT_INSURANCE_CREATE_BUTTON)
    AccidentInsuranceCreatePage clickCreateAccidentInsurence();

    @Click(INSURANCE_OF_PROPERTY_CARDS_AND_INTERNET_RISKS_CREATE_BUTTON)
    InsuranceOfPropertyCardsAndInternetRisksCreatePage clickCreateInsuranceOfPropertyCardsAndInternetRisks();

    @Click(ELECTRONIC_PAYMENT_INSURANCE_CREATE_BUTTON)
    ElectronicPaymentInsuranceCreatePage clickCreateElectronicPaymentInsurance();

    @Click (PAYMENTS_AND_EXPENSES_INSURANCE_CREATE_BUTTON)
    PaymentsAndExpensesCreatePage clickCreatePaymentsAndExpensesInsurance();

    @CheckElementContent(INSURANCE_TABLE)
    InsurancePage checkInsuranceIsFound(String insurance);

    @Click(value = EXHAUSTED_AMOUNT_INSURANCE_BUTTON)
    ExhaustedAmountInputPage clickCreateExhaustedAmountInsurance();

    @Wait(waitSecondsForElement = 15)
    @Click(LONG_TERM_INSURANCE_CREATE_BUTTON)
    LongTermTravelInsuranceCreatePage clickCreateLongTermInsurance();

    @Wait(LONG_TERM_EUROPE_SINGLE_INSURANCE)
    InsurancePage checkLongTravelEuropeSingleInsuranceIsFound();

    @Wait(SHORT_TERM_EUROPE_SINGLE_INSURANCE)
    InsurancePage checkShortTravelEuropeSingleInsuranceIsFound();

    @Wait(LONG_TERM_EUROPE_FAMILY_INSURANCE)
    InsurancePage checkLongTravelEuropeFamilyInsuranceIsFound();

    @Wait(SHORT_TERM_EUROPE_FAMILY_INSURANCE)
    InsurancePage checkShortTravelEuropeFamilyInsuranceIsFound();

    @Wait(LONG_TERM_WORLD_SINGLE_INSURANCE)
    InsurancePage checkLongTravelWorldSingleInsuranceIsFound();

    @Wait(SHORT_TERM_WORLD_SINGLE_INSURANCE)
    InsurancePage checkShortTravelWorldSingleInsuranceIsFound();

    @Wait(LONG_TERM_WORLD_FAMILY_INSURANCE)
    InsurancePage checkLongTravelWorldFamilyInsuranceIsFound();

    @Wait(SHORT_TERM_WORLD_FAMILY_INSURANCE)
    InsurancePage checkShortTravelWorldFamilyInsuranceIsFound();

    @Wait(ELECTRONIC_PAYMENT_INSURANCE_CHECK)
    InsurancePage checkElectronicPaymentInsuranceIsFound();

    @Wait(PAYMENTS_AND_EXPENSES_INSURANCE_CHECK)
    InsurancePage checkPaymentsAndExpensesInsuranceIsFound();

    @Wait (PROPERTY_CARDS_AND_INTERNET_RISK_INSURANCE_CHECK)
    InsurancePage checkPropertyCardsAndInternetRiskInsuranceIsFound();

    @Wait (ACCIDENT_ADULT_INSURANCE_CHECK)
    InsurancePage checkAccidentAdultInsuranceIsFound();

    @Wait (ACCIDENT_FAMILY_INSURANCE_CHECK)
    InsurancePage checkAccidentFamilyInsuranceIsFound();


    @Wait (ACCIDENT_JUNIOR_INSURANCE_CHECK)
    InsurancePage checkAccidentJuniorInsuranceIsFound();
}