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

import cz.moneta.test.dsl.ib.loans.consolidationloans.ConsolidationCalculatorPage;
import cz.moneta.test.dsl.ib.loans.expressloan.IbExpressLoanPage;
import cz.moneta.test.dsl.ib.loans.flexicredit.OfferFlexicreditApplicationPage;
import cz.moneta.test.harness.support.web.Builder;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.ib.loans.IbLoansLeftMenu.DEFERMENT_OF_INSTALLMENTS;
import static cz.moneta.test.dsl.ib.loans.IbLoansLeftMenu.MY_DOCUMENTS;
import static cz.moneta.test.dsl.ib.loans.IbLoansLeftMenu.OVERVIEW_OF_LOANS;
import static cz.moneta.test.dsl.ib.loans.IbLoansLeftMenu.OVERVIEW_OF_TRANSACTIONS;

@Wait({OVERVIEW_OF_LOANS, OVERVIEW_OF_LOANS, OVERVIEW_OF_TRANSACTIONS, MY_DOCUMENTS, DEFERMENT_OF_INSTALLMENTS})
public interface IbLoansLeftMenu extends Builder {
    String MENU_PARENT = "//ul[@id = 'navList']";

    String OVERVIEW_OF_LOANS = MENU_PARENT + "//a[text() = 'Přehled půjček']";
    String OVERVIEW_OF_TRANSACTIONS = MENU_PARENT + "//a[text() = 'Přehled transakcí']";
    String MY_DOCUMENTS = MENU_PARENT + "//a[text() = 'Moje dokumenty']";
    String DEFERMENT_OF_INSTALLMENTS = MENU_PARENT + "//a[text() = 'Odklad splátek']";
    String EXPESS_LOAN = MENU_PARENT + "//a[text() = 'Žádost o Expres půjčku']";
    String FLEXICREDIT_APPLICATION = MENU_PARENT + "//a[text() = 'Žádost o Flexikredit']";
    String REQUIRMENT_TO_CONSOLIDATION_LOANS = MENU_PARENT + "//a[text()='Žádost o Konsolidaci půjček']";

    @Wait(FLEXICREDIT_APPLICATION)
    @Click(value = FLEXICREDIT_APPLICATION, jsClick = true)
    OfferFlexicreditApplicationPage flexicreditApplication();

    @Click(REQUIRMENT_TO_CONSOLIDATION_LOANS)
    ConsolidationCalculatorPage clickRequirementToConsolidationLoans();

    @Wait(EXPESS_LOAN)
    @Click(EXPESS_LOAN)
    IbExpressLoanPage expressLoan();
}
