package cz.moneta.test.dsl.mobile.smartbanking.menu;

import cz.moneta.test.dsl.mobile.smartbanking.CurrentAccounts;
import cz.moneta.test.dsl.mobile.smartbanking.SbViewFlow;
import cz.moneta.test.dsl.mobile.smartbanking.accounts.AccountSelectionView;
import cz.moneta.test.dsl.mobile.smartbanking.templates.SmartBankingTemplatePage;
import cz.moneta.test.harness.support.mobile.MobileLookup;
import cz.moneta.test.harness.support.mobile.android.AndroidClick;
import cz.moneta.test.harness.support.mobile.android.AndroidScroll;
import cz.moneta.test.harness.support.mobile.android.AndroidWait;
import cz.moneta.test.harness.support.mobile.ios.IosClick;
import cz.moneta.test.harness.support.mobile.ios.IosScroll;
import cz.moneta.test.harness.support.mobile.ios.IosWait;
import cz.moneta.test.harness.support.mobile.share.Direction;

import static cz.moneta.test.dsl.mobile.smartbanking.menu.SmartBankingMenu.CURRENT_ACCOUNTS;
import static cz.moneta.test.dsl.mobile.smartbanking.menu.SmartBankingMenu.IOS_CURRENT_ACCOUNTS;

@AndroidWait(value = CURRENT_ACCOUNTS, by = MobileLookup.XPATH)
@IosWait(IOS_CURRENT_ACCOUNTS)
public interface SmartBankingMenu extends SbViewFlow<SmartBankingMenu> {
    String CURRENT_ACCOUNTS = "//android.widget.TextView[@text = 'Běžné účty']";
    String MY_TEMPLATES = "//android.widget.TextView[@text = 'Moje šablony']";

    String IOS_CURRENT_ACCOUNTS = "Běžné účty";
    String IOS_TEMPLATES = "Moje šablony";

    @AndroidScroll(direction = Direction.DOWN, untilElementPresent = MY_TEMPLATES, by = MobileLookup.XPATH,andClick = true)
    @IosScroll(direction = Direction.DOWN, untilElementPresent = IOS_TEMPLATES, andClick = true)
    SmartBankingTemplatePage clickOnMyTemplate();

    @AndroidClick(value = CURRENT_ACCOUNTS, by = MobileLookup.XPATH)
    @IosClick(IOS_CURRENT_ACCOUNTS)
    CurrentAccounts clickOnCurrentAccounts(); //use this method if user has more than one account

    @AndroidClick(value = CURRENT_ACCOUNTS, by = MobileLookup.XPATH)
    @IosClick(IOS_CURRENT_ACCOUNTS)
    AccountSelectionView currentAccountsUserHasOneAccount();
}
