package cz.moneta.test.dsl.hypos.pages.contract.loan;

import cz.moneta.test.dsl.hypos.components.Menu;
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.hypos.pages.contract.loan.ClientCurrentAcountPage.PAGE_TITLE;
import static cz.moneta.test.dsl.hypos.pages.contract.loan.ClientCurrentAcountPage.SAVE_BUTTON;

@Wait({PAGE_TITLE, SAVE_BUTTON})
public interface ClientCurrentAcountPage extends HyposPageFlow<ClientCurrentAcountPage>, Menu {
    String PAGE_TITLE = "//h1[text()='Účet pro splácení']";
    String CURRENT_ACCOUNTS_FORM = "//form[@id='form-bezneucty']";
    String SELECT_CURRENT_ACCOUNT_RADIO = CURRENT_ACCOUNTS_FORM + "//input[@value='%s']";
    String SAVE_BUTTON = CURRENT_ACCOUNTS_FORM + "//input[@value='Uložit']";
    String BACK_BUTTON = CURRENT_ACCOUNTS_FORM + "//input[@value='Návrat']";

    @Click(value = SELECT_CURRENT_ACCOUNT_RADIO, isStringDynamicXpath = true)
    ClientCurrentAcountPage setCurrentAccount(String currentAccount);

    @Click(SAVE_BUTTON)
    ClientCurrentAcountPage clickSaveCurrentAccount();

    @Click(BACK_BUTTON)
    LoanPage clickBackButton();
}
