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.dsl.ib.components.UserMenu;
import cz.moneta.test.harness.support.web.CheckElementPresent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.StoreElementContent;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.ib.account.saving.OverviewOfSavingsAccounts.OVERVIEW_SAVING_ACCOUNTS_PAGE_XPATH;

@Wait(OVERVIEW_SAVING_ACCOUNTS_PAGE_XPATH)
public interface OverviewOfSavingsAccounts extends IbPageFlow<OverviewOfSavingsAccounts>, MainMenu, UserMenu, SavingMenu {
    String OVERVIEW_SAVING_ACCOUNTS_PAGE_XPATH = "//img[@alt='Přehled spořicích účtů']";
    String FIRST_SAVING_ACCOUNT_XPATH = "//tr[@id='a1']";
    String ACCOUNT_NUMBER_XPATH = "//tr[@id='a1']//a[@class='blueNavWP']";
    String SAVING_ACCOUNT_NUMBER_KEY = "SAVING_ACCOUNT_NUMBER";
    String CANCEL_BUTTON = "//img[@src='images_new/zrusit_wb.gif']";

    @CheckElementPresent(FIRST_SAVING_ACCOUNT_XPATH)
    OverviewOfSavingsAccounts checkAccountAndGetAccountNumber();

    @Click(value = CANCEL_BUTTON)
    CancelSavingAccountEnteringPage clickToCancel();

    @StoreElementContent(storeKey = SAVING_ACCOUNT_NUMBER_KEY, value = ACCOUNT_NUMBER_XPATH)
    OverviewOfSavingsAccounts getSavingAccountNumber();
}