package cz.moneta.test.dsl.newib.accounts;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.dsl.newib.components.HorizontalMainMenu;
import cz.moneta.test.dsl.newib.components.VerticalMainMenu;
import cz.moneta.test.dsl.newib.mainpage.DashboardPage;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.newib.accounts.CurrentAccountPage.ACCOUNTS_TITLE_XPATH;
import static cz.moneta.test.dsl.newib.accounts.CurrentAccountPage.CURRENT_ACCOUNT_TITLE_XPATH;

@Wait(value = {CURRENT_ACCOUNT_TITLE_XPATH, ACCOUNTS_TITLE_XPATH}, waitSecondsForElement = 30)
public interface CurrentAccountPage extends IbPageFlow<CurrentAccountPage>, VerticalMainMenu, HorizontalMainMenu, AccountsTabs, StoreAccessor {
    String ACCOUNTS_TITLE_XPATH = "//h1[text()='Účty']";
    String CURRENT_ACCOUNT_TITLE_XPATH = "//h2[text()='Běžný účet CZK']";
    String FUTURE_PAYMENT_XPATH = "//button[.//span[contains(text(), 'Budoucí platby')]]";
    String OVERVIEW_BUTTON_XPATH = "//li[@data-testid='dashboard-link']//button[.//span[text()='Přehled']]";

    HistoryTab onHistoryTabs();

    @Click(FUTURE_PAYMENT_XPATH)
    FuturePaymentsPage clickOnFuturePayment();

    @Click(OVERVIEW_BUTTON_XPATH)
    DashboardPage clickOnOverviewButton();
}
