package cz.moneta.test.dsl.ib.account.saving;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.dsl.ib.components.MainMenu;
import cz.moneta.test.dsl.ib.components.SavingMenu;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.ib.account.saving.SavingsAccountPage.SAVING_ACCOUNTS_LIST_HEADER;

@Wait(value = SAVING_ACCOUNTS_LIST_HEADER)
public interface SavingsAccountPage extends IbPageFlow<SavingsAccountPage>, MainMenu, SavingMenu {
    String SAVING_ACCOUNTS_LIST_HEADER = "//div[@id='document']//td/img[contains(@src, 'prehled_sporeni.gif')]";
    String BUTTTON_SAVING_ACCOUNT_ESTABLISHMENT_ONLINE = "//table[@id='createSavings']//tr[2]//img[@alt='Založit online']";
    String SAVING_ACCOUNT_NAME_XPATH = "//a[contains(text(),'%s')]/ancestor::tr[@class='odd']//a[@class='blueNavWP']";

    @Click(BUTTTON_SAVING_ACCOUNT_ESTABLISHMENT_ONLINE)
    NewSavingAccountEnteringPage clickButtonEstablishmentOnlineSavingAccount();

    @Click(value = SAVING_ACCOUNT_NAME_XPATH, isStringDynamicXpath = true)
    OverviewOfSavingsAccounts clickToSpecificSavingAccountOnSavingAccountPage(String nameSavingAccount);

    @Click(TRANSFER_OF_FOUNDS)
    TransferOfFoundsMainPage clickToTransferOfFounds();
}