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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.newib.accounts.CurrentAccountPage;
import cz.moneta.test.dsl.newib.accounts.FuturePaymentsPage;
import cz.moneta.test.dsl.newib.accounts.HistoryTab;
import cz.moneta.test.dsl.newib.authentification.AuthMobileKey;
import cz.moneta.test.dsl.newib.authentification.LoginPage;
import cz.moneta.test.dsl.newib.components.HorizontalMainMenu;
import cz.moneta.test.dsl.newib.mainpage.*;
import cz.moneta.test.dsl.newib.messages.MessageDetailPage;
import cz.moneta.test.dsl.newib.messages.MessagesModalPage;
import cz.moneta.test.dsl.newib.payments.*;
import cz.moneta.test.dsl.newib.savings.*;
import cz.moneta.test.dsl.newib.settings.cards.CardsSettingsPage;
import cz.moneta.test.dsl.newib.settings.communication.contacts.ChangePasswordPage;
import cz.moneta.test.dsl.newib.settings.SettingsModalPage;
import cz.moneta.test.dsl.newib.settings.accounts.AccountsSettingsPage;
import cz.moneta.test.dsl.newib.settings.disponents.DisponentsSettingsPage;
import cz.moneta.test.dsl.newib.settings.mobileapplication.AboutTheSmartBankaPage;
import cz.moneta.test.dsl.newib.settings.communication.contacts.ContactsPage;
import cz.moneta.test.dsl.newib.settings.communication.contacts.PersonalAndContactDetailsPage;
import cz.moneta.test.dsl.newib.settings.envelopes.EnvelopesPage;
import cz.moneta.test.dsl.newib.settings.payments.directdebit.DirectDebitsPage;
import cz.moneta.test.dsl.newib.settings.payments.sipo.SipoOrdersPage;
import cz.moneta.test.dsl.newib.settings.payments.templates.TemplatesPage;
import cz.moneta.test.dsl.newib.settings.payments.trustedcontacts.TrustedContactsPage;
import cz.moneta.test.dsl.newib.util.*;
import cz.moneta.test.dsl.newib.documents.DocumentsModalPage;

import java.util.function.Function;

public final class NewIbTasks {

    private final Harness harness;

    public static String DEFAULT_MOBILE_KEY = "12341234";

    public NewIbTasks(Harness harness) {
        this.harness = harness;
    }

    public Function<LoginPage, DashboardPage> loginWithUsernamePasswordAndDefaultMobKey(String id, String password) {
        return start -> start.closeCookiesPanelIfVisible()
                .clickLoginWithIdAndPassword()
                .typeUsername(id)
                .clickContinue()
                .typePassword(password)
                .clickToLogin()
                .onAuthMobileKeyPage()
                .typeSmsKey(DEFAULT_MOBILE_KEY)
                .clickSend()
                .onDashboardPage();
    }

    public Function<DashboardPage, NewPaymentSummaryPage> domesticPaymentFormForClientWithOneAccount(PaymentFormData formData) {
        return start -> start.clickPayment()
                .getAccountNumber(harness)
                .fillNumberOfAccount(formData.getRecipientAccountNumber())
                .fillBankCode(formData.getBankCode())
                .fillAmount(formData.getAmount())
                .fillVariableSymbol(formData.getVariableSymbol())
                .fillConstantSymbol(formData.getConstantSymbol())
                .fillSpecificSymbol(formData.getSpecificSymbol())
                .selectTypeOfPayment(formData.getTypeOfPayment())
                .fillRecipientMessage(formData.getRecipientMessage())
                .fillMyNote(formData.getMyNote())
                .clickContinue();
    }

    public Function<NewPaymentSummaryPage, PaymentOrderSentPage> checkSummaryPaymentPageAndConfirmWithMobileKey(PaymentFormData formData) {
        return start -> start.checkFromAccount(formData.getFromAccountType())
                .checkToAccount(formData.getRecipientAccountNumber() + "/" + formData.getBankCode())
                .checkAmount(formData.getAmount())
                .checkTypeOfPayment(formData.getTypeOfPayment())
                .checkDateOfPayment(formData.getDateOfPayment())
                .checkVariableSymbol(formData.getVariableSymbol())
                .checkConstantSymbol(formData.getConstantSymbol())
                .checkSpecificSymbol(formData.getSpecificSymbol())
                .checkRecipientMessage(formData.getRecipientMessage())
                .checkMyNote(formData.getMyNote())
                .clickContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickContinueMobileKey();
    }

    public Function<DashboardPage, MobileOperatorsPaymentSummaryPage> setCreditPaymentForm(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickMore()
                .clickOnMobileOperatorsTab()
                .setPhoneNumber(formData.getPhoneNumber())
                .setOperator(formData.getMobileOperator())
                .setAmount(formData.getAmount())
                .setCategory(formData.getCategory())
                .clickOnSendMessageForRecipient()
                .setNoteForRecipient(formData.getRecipientMessage())
                .setConfirmationPhoneNumber(formData.getConfirmationPhoneNumber())
                .clickOnContinue();
    }

    public Function<DashboardPage, MobileOperatorsPaymentPage> setVodafoneInvoicePaymentForm(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickMore()
                .clickOnMobileOperatorsTab()
                .clickOnVodafoneInvoicePaymentBtn()
                .setPhoneNumber(formData.getPhoneNumber())
                .setAmount(formData.getAmount())
                .setCategory(formData.getCategory())
                .clickOnContinueVodafone();
    }

    public Function<MobileOperatorsPaymentSummaryPage, MobileOperatorsPaymentVictoryPage> checkSummaryCreditPaymentPageAndConfirmWithMobileKey(PaymentFormData formData) {
        return start -> start.checkRecipientPhoneNumber(formData.getPhoneNumber())
                .checkAmount(formData.getAmount())
                .checkCategory(formData.getCategory())
                .checkMobileOperator((formData.getMobileOperator()))
                .checkRecipientMessage(formData.getRecipientMessage())
                .checkConfirmationPhoneNumber(formData.getConfirmationPhoneNumber())
                .clickOnContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkCreditPaymentVictoryText();
    }

    public Function<MobileOperatorsPaymentSummaryPage, MobileOperatorsPaymentVictoryPage> checkSummaryVodafoneInvoicePaymentPageAndConfirmWithMobileKey(PaymentFormData formData) {
        return start -> start.checkAmount(formData.getAmount())
                .checkCategory(formData.getCategory())
                .clickOnContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkInvoicePaymentVictoryText();
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> setForeignPaymentForm(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressStreet(formData.getRecipientAddressStreet())
                .setRecipientAddressCity(formData.getRecipientAddressCity())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue();
    }

    public Function<NewForeignPaymentSummaryPage, NewForeignPaymentVictoryPage> checkSummaryForeignPaymentPageAndConfirmWithMobileKey(PaymentFormData formData) {
        return start -> start.checkToAccount(formData.getRecipientAccountNumber())
                .checkAmount(formData.getAmount())
                .checkCurrency(formData.getCurrency())
                .checkTypeOfCharge(formData.getTypeOfCharge())
                .checkBankCode(formData.getBankCodeBic())
                .checkBankCountry(formData.getBankCountry())
                .checkNameAddressOfBank(formData.getBankNameAddress())
                .checkRecipientName((formData.getRecipientName()))
                .checkRecipientCountry(formData.getRecipientAddressCountry())
                .checkRecipientMessage(formData.getRecipientMessage())
                .checkConfirmationEmail(formData.getConfirmationEmail())
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkForeignPaymentVictoryText();
    }

    public Function<DashboardPage, StandingOrderSummaryPage> setStandingOrderForm(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnStandingOrderTab()
                .setAccountNumber(formData.getRecipientAccountNumber())
                .setBankCode(formData.getBankCode())
                .setNameOfTheStandingOrder(formData.getStandingOrderName())
                .setAmount(formData.getAmount())
                .setDateOfLastPayment(formData.getLastDateOfPayment())
                .setFrequency(formData.getPaymentFrequency())
                .setVariableSymbol(formData.getVariableSymbol())
                .setConstantSymbol(formData.getConstantSymbol())
                .setSpecificSymbol(formData.getSpecificSymbol())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnContinue();
    }

    public Function<StandingOrderSummaryPage, DashboardPage> checkSummaryStandingOrderPageAndConfirmWithMobileKey(PaymentFormData formData) {
        return start -> start.checkToAccount(formData.getRecipientAccountNumber() + "/" + formData.getBankCode())
                .checkFromAccount(formData.getFromAccountNumber())
                .checkNameOfTheStandingOrder(formData.getStandingOrderName())
                .checkAmount(formData.getAmount())
                .checkDateOfFirstPayment(formData.getDateOfFirstPayment())
                .checkDateOfLastPayment(formData.getLastDateOfPayment())
                .checkFrequency(formData.getPaymentFrequency())
                .checkVariableSymbol(formData.getVariableSymbol())
                .checkConstantSymbol(formData.getConstantSymbol())
                .checkSpecificSymbol(formData.getSpecificSymbol())
                .checkRecipientMessage(formData.getRecipientMessage())
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkStandingOrderVictoryText()
                .goToDashboard();
    }

    public Function<DashboardPage, StandingOrderPage> goToStandingOrdersOverviewAndDeleteCreatedOne(PaymentFormData formData) {
        return start -> start.goToStandingOrders()
                .sleepRefreshAndCloseCookiesIfVisible(formData.getStandingOrderName())
                .deleteStandingOrder(formData.getStandingOrderName())
                .confirmDeleteStandingOrder()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkDeleteConfirmationVictoryTxt()
                .clickOnClose()
                .checkStandingOrderEditedCreatedInfo()
                .waitUntilStandingOrderDisappears(formData.getStandingOrderName(), formData.getAmount())
                .clickOnNewStandingOrder();
    }

    public Function<DashboardPage, SipoOrderSummaryPage> setSipoOrderForm(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickMore()
                .clickOnSipoTab()
                .setSipoNumber(formData.getSipoNumber())
                .setValueNotDivisible100("963")
                .setSipoEndDate(formData.getLastDateOfPayment())
                .checkAmountNotDivisibleError()
                .setSipoLimit(formData.getLimit())
                .clickOnContinue();
    }

    public Function<SipoOrderSummaryPage, SipoOrdersPage> checkSipoOrderSummaryPageAndConfirmWithMobileKey(PaymentFormData formData) {
        return start -> start.clickOnEdit()
                .clickOnContinue()
                .checkPaymentAccount(formData.getFromAccountNumber() + "/0600")
                .checkSipoNumber(formData.getSipoNumber())
                .checkSipoLimit(formData.getLimit())
                .checkEndDate(formData.getMonthOfEndSending())
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .handleSipoVictoryOrPrepared(formData.getSipoNumber(), formData.getLimit());
    }

    public Function<SipoOrdersPage, SipoOrdersPage> deleteSipoOrder(PaymentFormData formData) {
        return start -> start.sleepRefreshAndCloseCookiesIfVisible(formData.getSipoNumber(), formData.getFromAccountNumber() + "/0600", formData.getLimit() + ",00")
                .clickOnRemoveSipoOrder(formData.getSipoNumber())
                .checkSipoOrderRemoveTitle()
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkSipoOrderRemoveVictoryText()
                .goBackToSipoOverview()
                .checkSipoOrdersTitle()
                .checkNewSipoOrderBtn()
                .checkChangeOnSipoOrdersText(formData.getSipoNumber())
                .checkSipoIsDeletedAndRefreshIfNeeded(formData.getSipoNumber());
    }

    public Function<DashboardPage, DashboardPage> sendMortgageMessage(MessagesFormData messagesFormData) {
        return start -> start.goToMessages()
                .clickOnNewMessage()
                .setSubject(messagesFormData.getSubject())
                .setTopic(messagesFormData.getTopic())
                .setMessage(messagesFormData.getMessage())
                .clickOnSendMessage()
                .checkMessageSentVictoryTitle()
                .closeMessagesModal();
    }

    public Function<DashboardPage, MessageDetailPage> checkSentMessageAndDeleteCreatedOne(MessagesFormData messagesFormData) {
        return start -> start.goToMessages()
                .clickOnSentMessages()
                .checkSentMessagePresent(messagesFormData.getSubject())
                .goToMessageDetail(messagesFormData.getSubject())
                .deleteMessage()
                .confirm()
                .checkConfirmationDeleteTextPresent()
                .confirm();
    }

    public Function<DashboardPage, DashboardPage> sendOverlimitWithdrawalMessage(MessagesFormData messagesFormData) {
        return start -> start.goToMessages()
                .clickOnNewMessage()
                .setTopic(messagesFormData.getTopic())
                .setAmount(messagesFormData.getAmount())
                .setWithdrawalDate(messagesFormData.getWithdrawalDate())
                .setClientPhoneNumber(messagesFormData.getClientPhoneNumber())
                .setBranch(messagesFormData.getBranch())
                .setMessage(messagesFormData.getMessage())
                .clickOnAgreementW()
                .clickOnSendMessage()
                .checkMessageSentVictoryTitle()
                .closeMessagesModal();
    }

    public Function<DashboardPage, DashboardPage> sendForeignPaymentMessage(MessagesFormData messagesFormData) {
        return start -> start.goToMessages()
                .clickOnNewMessage()
                .setTopic(messagesFormData.getTopic())
                .setIban(messagesFormData.getIban())
                .setAmount(messagesFormData.getAmount())
                .setCurrency(messagesFormData.getCurrency())
                .setDueDate(messagesFormData.getDueDate())
                .setMessage(messagesFormData.getMessage())
                .clickOnAgreement()
                .setSubject(messagesFormData.getSubject())
                .clickOnSendMessage()
                .checkMessageSentVictoryTitle()
                .closeMessagesModal();
    }

    public Function<DashboardPage, DashboardPage> sendReqForRefundOfErroneousPaymentsMessage(MessagesFormData messagesFormData) {
        return start -> start.goToMessages()
                .clickOnNewMessage()
                .setTopic(messagesFormData.getTopic())
                .clickOnUrgent()
                .setTransactionDate(messagesFormData.getTransactionDate())
                .setDestinationAccNumber(messagesFormData.getDestinationAccNumber())
                .setBankCode(messagesFormData.getBankCode())
                .setAmount(messagesFormData.getAmount())
                .setVariableSymbol(messagesFormData.getVariableSymbol())
                .setConstantSymbol(messagesFormData.getConstantSymbol())
                .setSpecificSymbol(messagesFormData.getSpecificSymbol())
                .setAccNumberForRefund(messagesFormData.getAccNumberForRefund())
                .setRefundedBankCode(messagesFormData.getBankCodeForRefund())
                .setPhoneNumberForRefund(messagesFormData.getPhoneNumberForRefund())
                .setRecipientMessage(messagesFormData.getRecipientMessage())
                .clickOnAgreement()
                .setSubject(messagesFormData.getSubject())
                .clickOnSendMessage()
                .checkMessageSentVictoryTitle()
                .closeMessagesModal();
    }

    public Function<DashboardPage, DashboardPage> sendComplaintsAndClaimsMessage(MessagesFormData messagesFormData) {
        return start -> start.goToMessages()
                .clickOnNewMessage()
                .setTopic(messagesFormData.getTopic())
                .setTypeOfComplaintsAndClaims(messagesFormData.getTypeOfComplaintsAndClaims())
                .setSubject(messagesFormData.getSubject())
                .setMessage(messagesFormData.getMessage())
                .clickOnSendMessage()
                .checkMessageSentVictoryTitle()
                .closeMessagesModal();
    }

    public Function<DashboardPage, TemplatesPage> setDomesticTemplateForm(PaymentFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnTemplates()
                .createTemplate()
                .setTemplateName(formData.getTemplateName())
                .setDestinationAccPrefix(formData.getPrefixAccountNumber())
                .setDestinationAccNumber(formData.getRecipientAccountNumber())
                .setDestinationAccBank(formData.getBankCode())
                .setAmount(formData.getAmount())
                .setVariableSymbol(formData.getVariableSymbol())
                .setConstantSymbol(formData.getConstantSymbol())
                .setSpecificSymbol(formData.getSpecificSymbol())
                .setRecipientMessage(formData.getRecipientMessage())
                .setNoteForPayer(formData.getMyNote())
                .setCategory(formData.getCategory())
                .clickOnCreate()
                .clickOnBackToList();
    }

    public Function<TemplatesPage, TemplatesPage> checkTemplateAndDeleteCreatedOne(PaymentFormData formData) {
        return start -> start.checkTemplateName(formData.getTemplateName())
                .checkDestinationAccNumber(formData.getPrefixAccountNumber() + '-' + formData.getRecipientAccountNumber() + '/' + formData.getBankCode())
                .deleteTemplate()
                .confirmDeleteTemplate()
                .checkDeleteConfirmationTitleIsPresent()
                .closeModal();
    }

    public Function<DashboardPage, TemplatesPage> setForeignTemplateForm(PaymentFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnTemplates()
                .clickOnForeignTab()
                .createTemplate()
                .setTemplateName(formData.getTemplateName())
                .setIban(formData.getIban())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setFees(formData.getTypeOfCharge())
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressStreet(formData.getRecipientAddressStreet())
                .setRecipientAddressCity(formData.getRecipientAddressCity())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientNote(formData.getRecipientMessage())
                .clickOnConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnCreate()
                .clickOnBackToList();
    }

    public Function<TemplatesPage, TemplatesPage> checkForeignTemplateAndDeleteCreatedOne(PaymentFormData formData) {
        return start -> start.checkTemplateName(formData.getTemplateName())
                .checkDestinationAccNumber(formData.getIban())
                .deleteTemplate()
                .confirmDeleteTemplate()
                .checkDeleteConfirmationTitleIsPresent()
                .closeModal();
    }

    public Function<DashboardPage, DashboardPage> checkPaymentOptionsOnDashboard() {
        return start -> start.checkNewPaymentBtnIsPresent()
                .checkStandingOrdersBtnIsPresent()
                .checkHistoryBtnIsPresent()
                .goToNewPayment()
                .goToDashboard()
                .goToStandingOrders()
                .closeModal()
                .goToDashboard();
    }

    public Function<DashboardPage, StandingOrderPage> createStandingOrderViaSettings(PaymentFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnStandingOrders()
                .clickOnNewStandingOrder()
                .setAccountNumberPrefix(formData.getPrefixAccountNumber())
                .setAccountNumber(formData.getRecipientAccountNumber())
                .setBankCode(formData.getBankCode())
                .setNameOfTheStandingOrder(formData.getStandingOrderName())
                .setAmount(formData.getAmount())
                .setDateOfLastPayment(formData.getLastDateOfPayment())
                .setFrequency(formData.getPaymentFrequency())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnContinue()
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkStandingOrderVictoryText()
                .clickOnStandingOrders()
                .sleepRefreshAndCloseCookiesIfVisible(formData.getStandingOrderName())
                .clickOnStandingOrder(formData.getStandingOrderName())
                .checkAmount(formData.getAmount())
                .checkFrequency(formData.getPaymentFrequency())
                .clickOnEdit(formData.getStandingOrderName())
                .setAmount(formData.getAmount2())
                .clickOnContinue()
                .clickOnContinue()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkStandingOrderChangeVictoryText()
                .clickOnBackToStandingOrders()
                .waitUntilStandingOrderDisappears(formData.getStandingOrderName(), formData.getAmount())
                .deleteStandingOrder(formData.getStandingOrderName())
                .confirmDeleteChangedStandingOrder()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkDeleteConfirmationVictoryTxt()
                .clickOnClose()
                .checkStandingOrderEditedCreatedInfo()
                .waitUntilStandingOrderDisappears(formData.getStandingOrderName(), formData.getAmount2())
                .clickOnNewStandingOrder();
    }

    public Function<DashboardPage, SipoOrdersPage> createSipoOrderViaSettings(PaymentFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnSipo()
                .clickOnNewSipo()
                .setSipoNumber(formData.getSipoNumber())
                .setSipoLimit(formData.getLimit())
                .setSipoEndDate(formData.getLastDateOfPayment())
                .clickOnContinue()
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .goToDashboardFromSipoVictory()
                .clickOnSettings()
                .clickOnSipo()
                .sleepRefreshAndCloseCookiesIfVisible(formData.getSipoNumber(), formData.getFromAccountNumber() + "/0600", formData.getLimit() + ",00")
                .clickOnEdit(formData.getSipoNumber())
                .setSipoLimit("200")
                .clickOnContinue()
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkSipoOrderChangeVictoryText()
                .clickOnBackToSipoOrders()
                .sleepRefreshAndCloseCookiesIfVisible(formData.getSipoNumber(), formData.getFromAccountNumber() + "/0600", "200,00")
                .clickOnRemoveSipoOrder(formData.getSipoNumber())
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .goBackToSipoOverview()
                .checkSipoOrdersTitle()
                .checkNewSipoOrderBtn()
                .checkChangeOnSipoOrdersText(formData.getSipoNumber())
                .checkSipoIsDeletedAndRefreshIfNeeded(formData.getSipoNumber());
    }

    public Function<DashboardPage, ExchangePage> checkVerticalMenuItems() {
        return start -> start.checkUrl()
                .checkThemeSwitcherIsPresent()
                .checkIncomeExpensesOverviewIsPresent()
                .clickPayment()
                .checkNewPaymentTitlePresent()
                .goToAccounts()
                .checkUrl()
                .goToSavings()
                .checkUrl()
                .checkBuildingSavingsProductCardIsPresent()
                .goToLoansAndMortgages()
                .checkUrl()
                .checkMortgageBannerIsPresent()
                .checkLeasingBannerIsPresent()
                .goToCards()
                .checkUrl()
                .checkSmartCreditCardBannerIsPresent()
                .goToInsurance()
                .checkInsuranceHeadlineIsPresent()
                .goToInvestments()
                .confirmDisclaimer()
                .checkUrl()
                .checkInvestmentsTitleIsVisible()
                .checkInvestmentsHeaderIsVisible()
                .goToExchange();
    }

    public Function<DashboardPage, HorizontalMainMenu> checkHorizontalMenuItems() {
        return start -> start.checkUrl()
                .clickOnBlockBanking()
                .checkBlockBankingTitleIsPresent()
                .closeBlockBanking()
                .goToMessagesAndNotification()
                .checkUrl()
                .checkMessagesTitle()
                .checkNewMessageBtnIsPresent()
                .checkCloseBtnIsPresent()
                .closeMessagesModal()
                .goToDocuments()
                .checkUrl()
                .checkDocumentsTitleIsPresent()
                .checkFilterBtnIsPresent()
                .checkCloseBtnIsPresent()
                .closeDocumentsModal()
                .clickOnSettings()
                .checkUrl()
                .checkSettingsTitleIsPresent()
                .checkThemeSwitcherIsPresent()
                .closeSettingsModal()
                .clickLogout()
                .denyLogout()
                .clickOnHorizontalContacts()
                .checkContactsPopupTitle()
                .clickOnBlockingBanking()
                .checkBlockBankingTitleIsPresent()
                .closeBlockBanking()
                .goToContactsAndCheckUrl();
    }

    public Function<DashboardPage, BulkPaymentSummaryPage> setBulkPaymentForm(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnBulkPaymentTab()
                .setAccountNumber(formData.getRecipientAccountNumber())
                .setBankCode(formData.getBankCode())
                .setAmount(formData.getAmount())
                .clickOnContinue()
                .clickOnAddPayment()
                .setAccountNumber(formData.getRecipientAccountNumberOtherBank())
                .setBankCode(formData.getBankCodeOtherBank())
                .setAmount(formData.getAmountForBulkPayment())
                .setVariableSymbol(formData.getVariableSymbol())
                .setConstantSymbol(formData.getConstantSymbol())
                .setSpecificSymbol(formData.getSpecificSymbol())
                .setRecipientMessage(formData.getRecipientMessage())
                .setPayerNote(formData.getMyNote())
                .clickOnAddPayment()
                .setAccountNumber(formData.getRecipientAccountNumber())
                .setBankCode(formData.getBankCode())
                .setAmount(formData.getAmountOverLimit())
                .clickOnContinue()
                .clickOnContinue()
                .checkOverLimitPaymentWarningText(formData.getOverLimitPaymentWarningText())
                .clickOnBack()
                .clickOnDeletePayment()
                .clickOnCancelModalClose()
                .clickOnDeletePayment()
                .clickOnCancelModalConfirm();
    }

    public Function<BulkPaymentSummaryPage, HistoryTab> checkSummaryBulkPaymentPageAndConfirmWithMobileKey(PaymentFormData formData) {
        return start -> start.checkNumberOfPayments(formData.getNumberOfPayments())
                .checkRecipientAccNumber(formData.getRecipientAccountNumber() + "/" + formData.getBankCode())
                .checkAmount(formData.getAmount())
                .checkRecipientAccNumber(formData.getRecipientAccountNumberOtherBank() + "/" + formData.getBankCodeOtherBank())
                .checkAmount(formData.getAmountForBulkPayment())
                .clickOnContinue()
                .clickOnSubmit()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkBulkPaymentVictoryPage(formData.getNumberOfBulkPaymentVictoryText(), formData.getTotalAmountBulkPayment());
    }

    public Function<DashboardPage, ContactsPage> createNewContactAndDeleteCreatedOne(ContactsFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnContacts()
                .checkContactForMobileKeyExist()
                .createNewContact()
                .clickSubmitStayOnPage()
                .checkValidationTextsArePresent()
                .setName(formData.getName())
                .setPhoneNumber(formData.getPhoneNumber())
                .setOperator(formData.getOperator())
                .submitNewContact()
                .checkVictoryScreenIsPresent()
                .clickOnBackToContacts()
                .checkCreatedContactName(formData.getName())
                .editContact(formData.getName())
                .setName(formData.getName() + "edited")
                .submitNewContact()
                .checkEditVictoryScreenIsPresent()
                .clickOnBackToContacts()
                .checkCreatedContactName(formData.getName() + "edited")
                .deleteContact(formData.getName() + "edited")
                .confirmDeleteContact()
                .checkContactDeletedVictoryTextIsPresent()
                .closeDeletedContactConfirmationModal();
    }

    public Function<DashboardPage, EnvelopesPage> createNewEnvelopeEditAndDeleteCreatedOne(EnvelopesFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnEnvelopes()
                .checkNoEnvelopesMessageIsPresent()
                .createNewEnvelope()
                .setEnvelopeName(formData.getEnvelopeName())
                .setAmount(formData.getAmount())
                .submitNewEnvelope(formData.getCategory())
                .checkVictoryScreenIsPresent()
                .clickOnBackToEnvelopes()
                .checkCreatedEnvelopeIsPresent(formData.getEnvelopeName(), formData.getAmount())
                .editEnvelope(formData.getEnvelopeName())
                .changeEnvelopeName(formData.getEnvelopeName() + "edited")
                .changeAmount("200")
                .submitEditedEnvelope()
                .checkEditVictoryScreenIsPresent()
                .clickOnBackToEnvelopes()
                .checkCreatedEnvelopeIsPresent(formData.getEnvelopeName() + "edited", "200,00")
                .deleteEnvelope()
                .checkDeleteEnvelopeModalIsPresent(formData.getEnvelopeName() + "edited")
                .confirmDeleteEnvelope()
                .checkEnvelopeDeletedVictoryTextIsPresent()
                .closeDeletedEnvelopeConfirmationModal()
                .checkNoEnvelopesMessageIsPresent();
    }

    public Function<DashboardPage, SettingsModalPage> changeIdViaSettings() {
        return start -> start.clickOnSettings()
                .clickOnChangeId()
                .checkModalTitleIsPresent()
                .checkModalTextIsPresent()
                .clickOnDecline();
    }

    public Function<DashboardPage, DirectDebitSummaryPage> setDirectDebitForm(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickMore()
                .clickOnDirectDebitTab()
                .fillPrefixAccountNumber(formData.getRecipientAccountNumberPrefix())
                .fillAccountNumber(formData.getRecipientAccountNumber())
                .setBankCode(formData.getBankCode())
                .fillNameOfDirectDebit(formData.getDirectDebitName())
                .fillDirectDebitLimit(formData.getDirectDebitLimit())
                .fillDateOfLastPayment(formData.getDateOfLastPayment())
                .selectFrequencyOfDirectDebit(formData.getFrequencyOfPayments())
                .clickOnContinue()
                .clickBack()
                .clickOnContinue();
    }

    public Function<DirectDebitSummaryPage, DirectDebitVictoryPage> checkSummaryDebitForm(PaymentFormData formData) {
        return start -> start.checkPaymentFromAccount(formData.getFromAccountNumber() + "/0600")
                .checkPaymentToAccount(formData.getRecipientAccountNumberPrefix() + "-" + formData.getRecipientAccountNumber() + "/" + formData.getBankCode())
                .checkNameOfDirectDebit(formData.getDirectDebitName())
                .checkLimitOfDirectDebit(formData.getDirectDebitLimit())
                .checkDateOfFirstPayment(formData.getDateOfFirstPayment())
                .checkEndDateOfDirectDebit(formData.getDateOfLastPayment())
                .checkFrequencyOfDirectDebit(formData.getFrequencyOfPayments())
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey();
    }

    public Function<DirectDebitVictoryPage, DirectDebitsPage> checkVictoryPageOfDirectDebit(PaymentFormData formData) {
        return start -> start.handleDirectDebitVictoryOrPrepared(formData.getDateOfFirstPayment(), formData.getFromAccountNumber() + "/0600")
                .clickOnSettings()
                .clickOnDirectDebit()
                .sleepRefreshAndCloseCookiesIfVisible(formData.getDirectDebitName(), formData.getFromAccountNumber(), formData.getDirectDebitLimit());
    }

    public Function<DashboardPage, ExchangePage> checkExchange(ExchangeFormData formData) {
        return start -> start.goToExchange()
                .checkBuyCurrency("USD")
                .setFirstExchangeAmount("10")
                .clickOnRequestExchangeRate()
                .checkMinimumDebitAmountAlert()
                .setSecondExchangeAmount("10")
                .clickOnRequestExchangeRate()
                .checkMinimumCreditAmountAlert()
                .setFirstExchangeAmount(formData.getFirstAmount())
                .clickOnRequestExchangeRate()
                .clickOnNewSale()
                .clickOnRequestExchangeRate()
                .checkValidityOfferedRateIsPresent()
                .clickOnConcludeSale()
                .checkVictoryScreenIsPresent()
                .checkSaleAmountIsPresent()
                .clickOnNewSale()
                .clickOnSwapAccounts()
                .checkSellCurrency("USD")
                .setSecondExchangeAmount(formData.getFirstAmount())
                .clickOnRequestExchangeRate()
                .clickOnConcludeSale()
                .checkVictoryScreenIsPresent()
                .checkBuyAmountIsPresent()
                .clickOnNewSale()
                .setSecondExchangeAmount(formData.getSecondAmount())
                .clickOnRequestExchangeRate()
                .clickOnConcludeSale()
                .checkVictoryScreenIsPresent()
                .checkBuyCurrencyAmountIsPresent("USD")
                .clickOnNewSale()
                .clickOnSwapAccounts()
                .setFirstExchangeAmount(formData.getSecondAmount())
                .clickOnRequestExchangeRate()
                .clickOnConcludeSale()
                .checkVictoryScreenIsPresent()
                .checkSellCurrencyAmountIsPresent("USD")
                .clickOnNewSale()
                .clickOnTomAccount()
                .selectToAccount()
                .checkBuyCurrency("EUR")
                .setSecondExchangeAmount(formData.getSecondAmount())
                .clickOnRequestExchangeRate()
                .clickOnConcludeSale()
                .checkVictoryScreenIsPresent()
                .checkSellCurrencyAmountIsPresent("EUR")
                .clickOnNewSale()
                .setFirstExchangeAmount(formData.getFirstAmount())
                .clickOnRequestExchangeRate()
                .waitUntilTimerRunsOutCheckAlert()
                .clickOnRequestExchangeRate()
                .clickOnConcludeSale()
                .checkVictoryScreenIsPresent()
                .checkSaleAmountIsPresent()
                .clickOnBackToOverview();
    }

    public Function<DashboardPage, AboutTheSmartBankaPage> checkAboutTheSmartBanka() {
        return start -> (AboutTheSmartBankaPage) start.clickOnSettings()
                .clickOnAboutTheSmartBanka()
                .checkUrl()
                .checkTitleIsPresent()
                .checkBackToSettingsIsPresent()
                .checkActivateUpIsPresent()
                .checkActivateDownIsPresent()
                .checkMoreInformationIsPresent()
                .clickOnActivateUp()
                .checkRedirectingToOldIbTitleIsPresent()
                .clickOnCancel()
                .clickOnActivateDown()
                .checkRedirectingToOldIbTitleIsPresent()
                .clickOnCancel()
                .clickOnBackToSetting()
                .checkSettingsTitleIsPresent()
                .clickOnAboutTheSmartBanka()
                .clickOnClose()
                .clickOnSettings()
                .clickOnAboutTheSmartBanka()
                .goToMoreInformationsAndCheckUrl();
    }

    public Function<DashboardPage, AboutTheSmartBankaPage> checkAboutTheSmartBankaAuthorization() {
        return start -> (AboutTheSmartBankaPage) start.clickOnSettings()
                .clickOnAuthorizations()
                .checkAuthorizationTitleIsPresent()
                .clickPush()
                .checkModalTitleIsPresent()
                .clickOnDecline()
                .clickPush()
                .clickOnConfirm()
                .checkUrl()
                .checkTitleIsPresent()
                .checkBackToSettingsIsPresent()
                .checkActivateUpIsPresent()
                .checkActivateDownIsPresent()
                .checkMoreInformationIsPresent()
                .clickOnActivateUp()
                .checkRedirectingToOldIbTitleIsPresent()
                .clickOnCancel()
                .clickOnActivateDown()
                .checkRedirectingToOldIbTitleIsPresent()
                .clickOnCancel()
                .clickOnBackToSetting()
                .checkSettingsTitleIsPresent()
                .clickOnAboutTheSmartBanka()
                .clickOnClose()
                .clickOnSettings()
                .clickOnAboutTheSmartBanka()
                .goToMoreInformationsAndCheckUrl();
    }

    public Function<DashboardPage, DashboardPage> changeLimitsViaSettings(PaymentFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnLimits()
                .checkUrl()
                .checkBackToSettingsIsPresent()
                .checkCloseBtnIsPresent()
                .clickOnBackToSettings()
                .clickOnLimits()
                .checkTextComponentIBIsPresent()
                .checkTextComponentSBIsPresent()
                .checkInternetBankaDayLimitActive()
                .checkInternetBankaWeekLimitUnactive()
                .checkInternetBankaDayLimitValueIsPresent(formData.getAmount())
                .clickOnInternetBankyWeekLimitActivate()
                .changeInternetBankaDayLimit("100")
                .changeInternetBankaWeekLimit("200")
                .checkSmartBankaDayLimitActive()
                .checkSmartBankaWeekLimitUnactive()
                .checkSmartBankaDayLimitValueIsPresent(formData.getAmount())
                .clickOnSmartBankyWeekLimitActivate()
                .changeSmartBankaDayLimit("300")
                .changeSmartBankaWeekLimit("400")
                .clickOnContinueBtn()
                .checkInternetBankaDayLimit("100")
                .checkInternetBankaWeekLimit("200")
                .checkSmartBankaDayLimit("300")
                .checkSmartBankaWeekLimit("400")
                .clickOnConfirmBtn()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnConfirm()
                .checkVictoryTitleIsPresent()
                .clickOnBackToLimits()
                .checkInternetBankaDayLimitValueIsPresent("100")
                .checkInternetBankaWeekLimitValueIsPresent("200")
                .checkSmartBankaDayLimitValueIsPresent("300")
                .checkSmartBankaWeekLimitValueIsPresent("400")
                .clickOnCloseBtn();
    }

    public Function<DashboardPage, DashboardPage> resetLimitsViaSettings(PaymentFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnLimits()
                .clickOnInternetBankyWeekLimitActivate()
                .changeInternetBankaDayLimit(formData.getAmount())
                .clickOnSmartBankyWeekLimitActivate()
                .changeSmartBankaDayLimit(formData.getAmount())
                .clickOnContinueBtn()
                .checkInternetBankaDayLimit(formData.getAmount())
                .checkSmartBankaDayLimit(formData.getAmount())
                .clickOnConfirmBtn()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnConfirm()
                .checkVictoryTitleIsPresent()
                .clickOnBackToLimits()
                .checkInternetBankaDayLimitValueIsPresent(formData.getAmount())
                .checkSmartBankaDayLimitValueIsPresent(formData.getAmount())
                .clickOnCloseBtn();
    }

    public Function<DashboardPage, TrustedContactsPage> checkTrustedContacts(TrustedContactsFormData formData) {
        return start -> start.clickOnSettings()
                .clickOnTrustedContacts()
                .checkUrl()
                .checkCloseBtnIsPresent()
                .checkBackToSettingsIsPresent()
                .clickOnBackToSettings()
                .clickOnTrustedContacts()
                .checkTrustedContactsInfoTextIsPresent()
                /*.checkInfoTextComponetIsPresent()
                .checkAccountTextComponetIsPresent()
                .checkUsedInTemplateTextComponetIsPresent()
                .checkCreatedTextComponetIsPresent()
                .checkFullTextFilterIsPresent()
                .clickOnShowMoreAccounts()
                .clickOnDelete()
                .checkTitleIsPresent()
                .checkInfoTextIsPresent()
                .clickOnDecline()
                .clickOnTrustedAccount()
                .checkNameIsNotEmpty()
                .checkAccountNumberIsNotEmpty()
                .checkCreateDateIsNotEmpty()
                .checkUsedInTemplateIsNotEmpty()
                .clickOnEdit()
                .setLongName(formData.getSetNameOfTrustedContactLong())
                .clickOnSave()
                .checkLongName()
                .clickOnEdit()
                .clickOnCancel()
                .checkLongName()
                .clickOnEdit()
                .setShortName(formData.getSetNameOfTrustedContactShort())
                .clickOnSave()
                .checkShortName()*/
                .clickOnCloseBtn();
    }

    public Function<DashboardPage, PersonalAndContactDetailsPage> personalAndContactDetailsSettings() {
        return start -> start.clickOnSettings()
                .clickOnPersonalAndContactDetailsSettings()
                .checkPermanentFirstNameIsPresent("Automat")
                .checkPermanentLastNameIstpresent("OsobníAkontaktníÚdaj")
                .checkPermanentTitleIsPresent("Ing.")
                .checkPermanentStreetIsPresent("Na Kleovce 2162/2")
                .checkPermanentCityIsPresent("Praha 2")
                .checkPermanentZipIsPresent("12000")
                .checkPermanentCountryIsPresent("Česká republika")
                .checkContactStreetIsPresent("Na Kleovce 2162/2")
                .checkContactCityIsPresent("Praha 2")
                .checkContactZipIsPresent("12000")
                .checkContactCountrytIsPresent("Česká republika")
                .checkContactMobileIsPresent("+420 606 072 184")
                .checkContactEmailIsPresent("testbest@moneta.cz")
                .checkAlertTextIsPresent()
                .clickOnEdit()
                .checkEditTitleIsPresent()
                .checkCheckboxIsCheck()
                .checkStreetIsDisable()
                .checkDescriptiveNumberIsDisable()
                .checkOrientationNumberIsDisable()
                .checkTownIsDisable()
                .checkZipIsDisable()
                .checkCountryIsDisable()
                .checkMobilePhoneIsDisable()
                .checkEmailIsEnable()
                .clickOnCheckbox()
                .fillStreet("")
                .clickOnConfirmButton()
                .checkStreetErrorMessage()
                .fillStreet("Na Kleovce")
                .clickOnConfirmButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnConfirm()
                .checkVictoryHeaderIsPresent()
                .checkVictorySentenceIsPresent()
                .clickOnSubmitButton()
                .checkTitleIsPresent();
    }

    public Function<DashboardPage, DashboardPage> newClientSetupCards() {
        return start -> start
                .clickAgreeWithMobileKey()
                .clickAcceptMobileKey()
                .typeSmsKey("12341234")
                .clickFinalAgreeWithMobileKey();
    }

    public Function<DashboardPage, CardsOnboardingFinalPage> onboardingOfPlasticDebitCard() {
        return start -> start
                .goToAccounts()
                .clickOnNewDebitCard()
                .clickPlasticCardFreeButton()
                .clickDontWantToPayFasterButton()
                .clickContinueButton()
                .clickContinueButtonAndWaitForVisibleButton()
                .waitForLoader()
                .clickUnderstandAndAgreeButton()
                .waitForLoader()
                .clickSign()
                .typeSmsKey("12341234")
                .clickSignToFinalPage()
                .waitForConfirmationOfPlasticOnboarding();
    }

    public Function<DashboardPage, CardsOnboardingFinalPage> onboardingOfVirtualDebitCard() {
        return start -> start
                .goToAccounts()
                .clickOnNewDebitCard()
                .clickVirtualCardFreeButton()
                .clickDontWantToPayFasterButton()
                .clickContinueButton()
                .clickContinueButtonAndWaitForVisibleButton()
                .waitForLoader()
                .clickUnderstandAndAgreeButton()
                .waitForLoader()
                .clickSign()
                .typeSmsKey("12341234")
                .clickSignToFinalPage()
                .waitForConfirmationOfVirtualOnboarding();
    }

    public Function<DashboardPage, CardsPage> checkMaxNumberOfCardsOnboarded() {
        return start -> start
                .goToAccounts()
                .checkNewDebitCardNotVisible()
                .goToCards()
                .checkNewDebitCardNotVisible();
    }

    public Function<CardsPage, CardsPage> cancelDebitCard() {
        return start -> start
                .clickCancelCardRadio()
                .clickContinue()
                .then(smsKeyAuthorizationPopup())
                .cancelMessageAppeared()
                .clickBackToCard()
                .clickDetailsAndSettings()
                .checkCardDetailInfo("Zrušená");
    }

    public Function<DashboardPage, CardsPage> showPinOnDebitCard(String accountNumber, String cardNumber) {
        return start -> start
                .goToCards()
                .clickAccountNumber(accountNumber)
                .clickCardNumber(cardNumber)
                .clickNextSettings()
                .clickShowPin()
                .clickShowPinButton()
                .typeMobileKey(DEFAULT_MOBILE_KEY)
                .clickToShowPinAndWait();
    }

    public Function<DashboardPage, CardsPage> showPinOnCreditCard(String cardNumber) {
        return start -> start
                .goToCards()
                .clickCardNumber(cardNumber)
                .clickNextSettings()
                .clickShowPin()
                .clickShowPinButton()
                .typeMobileKey(DEFAULT_MOBILE_KEY)
                .clickToShowPinAndWait();
    }

    public Function<DashboardPage, DashboardPage> conditionallyApproveApplicationInProgress() {
        return start -> start
                .clickApplicationHeaderText()
                .scrollToBottom()
                .clickAgreeAndContinueToSign()
                .fillMobKey(DEFAULT_MOBILE_KEY)
                .clickSign()
                .checkSuccessApplicationSent()
                .clickReturnToOverview();
    }

    public Function<DashboardPage, DashboardPage> checkAndSignNewDocument() {
        return start -> start
                .clickCheckAndSignNewDocument()
                .scrollToBottom()
                .clickContinueToSign()
                .fillMobKey(DEFAULT_MOBILE_KEY)
                .clickSign();
    }

    public Function<DashboardPage, DashboardPage> createTermDeposit(SavingsFormData formData) {
        return start -> start
                .checkBannersPresent()
                .goToSavings()
                .clickOnCreateTvForCurrency(formData.getCurrency())
                .clickOnAccount()
                .selectAccount(formData.getCurrency())
                .setLimitAmountMin(formData.getLimitAmountMin())
                .checkMinimumLimit()
                .setLimitAmountMax(formData.getLimitAmountMax())
                .checkMaximumLimit()
                .setAmount(formData.getAmount())
                .clickOnTV(formData.getTermDepositType())
                .clickOnPeriod()
                .selectPeriod(formData.getTermDepositPeriod())
                .clickOnTaxResidence()
                .selectTaxResidence(formData.getTaxResidence1())
                .handleTaxIdIfPresent1("987654321")
                .clickOnAddNextTaxResidence()
                .clickOnNextTaxResidence1()
                .selectTaxResidence(formData.getTaxResidence2())
                .handleTaxIdIfPresent2("123456789")
                .checkNextTaxResidenceButtonExist()
                .clickOnConfirmTV()
                .scrollToBottom()
                .clickOnCheckBox()
                .clickOnAgreePrecontract()
                .fillMobKey(DEFAULT_MOBILE_KEY)
                .clickOnSubmit()
                .checkSuccessApplicationSent()
                .clickOnBackToDashboard()
                .checkLoadDashboard();
    }

    public Function<DashboardPage, DashboardPage> createAndCancelTermDeposit(SavingsFormData formData) {
        return start -> start
                .goToSavings()
                .clickOnCreateTvForCurrency(formData.getCurrency())
                .clickOnAccount()
                .selectAccount(formData.getCurrency())
                .setAmount(formData.getAmount())
                .clickOnTV(formData.getTermDepositType())
                .clickOnPeriod()
                .selectPeriod(formData.getTermDepositPeriod())
                .clickOnTaxResidence()
                .selectTaxResidence(formData.getTaxResidence1())
                .handleTaxIdIfPresent1("987654321")
                .clickOnAddNextTaxResidence()
                .clickOnNextTaxResidence1()
                .selectTaxResidence(formData.getTaxResidence2())
                .clickOnAddNextTaxResidence()
                .clickOnNextTaxResidence2()
                .selectTaxResidence(formData.getTaxResidence3())
                .clickOnAddNextTaxResidence()
                .clickOnNextTaxResidence3()
                .selectTaxResidence(formData.getTaxResidence4())
                .clickOnAddNextTaxResidence()
                .clickOnNextTaxResidence4()
                .selectTaxResidence(formData.getTaxResidence5())
                .checkNextTaxResidenceButtonDoesntExist()
                .clickOnConfirmTV1()
                .confirmInvalidDic()
                .scrollToBottom()
                .clickOnDecline()
                .clickOnConfirmDisagreement()
                .checkLoadDashboard();
    }

    public Function<DashboardPage, NewForeignPaymentVictoryPage> setDomesticForeignPaymentForm(PaymentFormData formData) {
        return start -> start.clickPayment()
                .fillNumberOfAccount(formData.getRecipientAccountNumberEur())
                .fillBankCode(formData.getBankCode())
                .fillAmount(formData.getAmount())
                .fillCurrency(formData.getCurrency())
                .checkAllInfoBlocksPresent()
                .clickOnIndividualRateOn()
                .checkIndividualInfoExist()
                .clickContinueIndividual()
                .checkIndividualPopupExist()
                .clickOnDecline()
                .clickContinueIndividual()
                .clickOnConfirm()
                .clickOnBack()
                .clickOnIndividualRateOff()
                .fillVariableSymbol(formData.getVariableSymbol())
                .fillConstantSymbol(formData.getConstantSymbol())
                .fillSpecificSymbol(formData.getSpecificSymbol())
                .fillRecipientMessage(formData.getRecipientMessage())
                .clickContinue()
                .checkFromAccount(formData.getFromAccountType())
                .checkToAccount(formData.getRecipientAccountNumberEur() + "/" + formData.getBankCode())
                .checkAmount(formData.getAmount())
                .checkVariableSymbol(formData.getVariableSymbol())
                .checkConstantSymbol(formData.getConstantSymbol())
                .checkSpecificSymbol(formData.getSpecificSymbol())
                .checkRecipientMessage(formData.getRecipientMessage())
                .clickContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickContinueButton();
    }

    public Function<FuturePaymentsPage, FuturePaymentsPage> checkFutureTransaction(PaymentFormData formData) {
        return start -> start.checkToAccount(formData.getRecipientAccountNumber() + "/" + formData.getBankCode())
                .checkDateOfPayment(formData.getDateOfPayment())
                .checkVariableSymbol(formData.getVariableSymbol())
                .checkConstantSymbol(formData.getConstantSymbol())
                .checkSpecificSymbol(formData.getSpecificSymbol())
                .checkRecipientMessage(formData.getRecipientMessage())
                .checkMyNote(formData.getMyNote());
    }

    public Function<DashboardPage, NewPaymentSummaryPage> setDomesticPriorityPaymentFirstStep(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnFromAccount()
                .checkFromAccount()
                .selectFromAccount()
                .fillNumberOfAccount(formData.getRecipientAccountNumber())
                .fillBankCode(formData.getBankCode())
                .fillAmount(formData.getAmount())
                .clickOnTypeOfPayment()
                .checkPriorityPaymentTypeDisabled()
                .fillNumberOfAccount(formData.getRecipientAccountNumberOtherBank())
                .fillBankCode(formData.getBankCodeOtherBank())
                .selectTypeOfPayment(formData.getTypeOfPayment())
                .selectCategory(formData.getCategory())
                .fillVariableSymbol(formData.getVariableSymbol())
                .fillConstantSymbol(formData.getConstantSymbol())
                .fillSpecificSymbol(formData.getSpecificSymbol())
                .fillRecipientMessage(formData.getRecipientMessage())
                .fillMyNote(formData.getMyNote())
                .clickContinue();
    }

    public Function<NewPaymentSummaryPage, PaymentOrderSentPage> setDomesticPriorityPaymentSecondStep(PaymentFormData formData) {
        return start -> start.checkFromAccount(formData.getFromAccountType())
                .checkToAccount(formData.getRecipientAccountNumberOtherBank() + "/" + formData.getBankCodeOtherBank())
                .checkAmount(formData.getAmount())
                .checkTypeOfPayment(formData.getTypeOfPayment())
                .checkDateOfPayment(formData.getDateOfPayment())
                .clickContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickContinueMobileKey();
    }

    public Function<PaymentOrderSentPage, CurrentAccountPage> setDomesticPaymentThirdStep(PaymentFormData formData) {
        return start -> start.checkPaymentOrderSentTitle()
                .checkEnvelopeText()
                .checkStandingOrderText()
                .checkCategoryField(formData.getCategory())
                .clickOverviewTransactions();
    }

    public Function<DashboardPage, NewPaymentDomesticPage> setDomesticPaymentSaveTemplate(PaymentFormData formData) {
        return start -> start.clickPayment()
                .fillNumberOfAccount(formData.getRecipientAccountNumber())
                .fillBankCode(formData.getBankCode())
                .fillAmount(formData.getAmount())
                .fillVariableSymbol(formData.getVariableSymbol())
                .fillConstantSymbol(formData.getConstantSymbol())
                .fillSpecificSymbol(formData.getSpecificSymbol())
                .fillRecipientMessage(formData.getRecipientMessage())
                .fillMyNote(formData.getMyNote())
                .selectSaveAsTemplateCheckbox()
                .fillTemplateName(formData.getTemplateName())
                .clickContinue()
                .clickContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickContinueMobileKey()
                .clickNextPaymentButton();
    }

    public Function<NewPaymentDomesticPage, PaymentOrderSentPage> setDomesticPaymentFromTemplate(PaymentFormData formData) {
        return start -> start.clickOnMyAccounts()
                .selectTemplate(formData.getTemplateName())
                .clickContinue()
                .checkFromAccount(formData.getFromAccountType())
                .checkToAccount(formData.getRecipientAccountNumber() + "/" + formData.getBankCode())
                .checkAmount(formData.getAmount())
                .checkVariableSymbol(formData.getVariableSymbol())
                .checkConstantSymbol(formData.getConstantSymbol())
                .checkSpecificSymbol(formData.getSpecificSymbol())
                .checkRecipientMessage(formData.getRecipientMessage())
                .checkMyNote(formData.getMyNote())
                .clickContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickContinueMobileKey();
    }

    public Function<TemplatesPage, TemplatesPage> deleteTemplate(PaymentFormData formData) {
        return start -> start.checkTemplateName(formData.getTemplateName())
                .checkDestinationAccNumber(formData.getRecipientAccountNumber() + '/' + formData.getBankCode())
                .deleteTemplate()
                .confirmDeleteTemplate()
                .checkDeleteConfirmationTitleIsPresent()
                .closeModal();
    }

    public Function<DashboardPage, NewPaymentDomesticPage> setDomesticPaymentFirstStep(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnFromAccount()
                .checkFromAccount()
                .selectFromAccount()
                .fillNumberOfAccount(formData.getRecipientAccountNumber())
                .fillBankCode(formData.getBankCode())
                .fillAmount(formData.getAmount())
                .selectCategory(formData.getCategory())
                .fillVariableSymbol(formData.getVariableSymbol())
                .fillConstantSymbol(formData.getConstantSymbol())
                .fillSpecificSymbol(formData.getSpecificSymbol())
                .fillRecipientMessage(formData.getRecipientMessage())
                .fillMyNote(formData.getMyNote())
                .selectTypeOfPayment(formData.getTypeOfPayment());
    }

    public Function<DashboardPage, NewPaymentDomesticPage> setDomesticPaymentToOwnAccount(PaymentFormData formData, String savingsAccount) {
        return start -> start.clickPayment()
                .clickOnFromAccount()
                .checkFromAccount()
                .selectFromAccount()
                .clickOnMyAccounts()
                .selectSavingsAccount()
                .checkDestinationAccountNumber(savingsAccount)
                .checkDestinationAccountBank("0600")
                .fillAmount(formData.getAmount())
                .selectCategory(formData.getCategory())
                .fillVariableSymbol(formData.getVariableSymbol())
                .fillConstantSymbol(formData.getConstantSymbol())
                .fillSpecificSymbol(formData.getSpecificSymbol())
                .fillRecipientMessage(formData.getRecipientMessage())
                .fillMyNote(formData.getMyNote());
    }

    public Function<NewPaymentSummaryPage, PaymentOrderSentPage> checkSummaryPaymentToOwnAccountPageAndConfirm(PaymentFormData formData, String savingsAccount) {
        return start -> start.checkFromAccount(formData.getFromAccountType())
                .checkToAccount(savingsAccount + "/" + "0600")
                .checkAmount(formData.getAmount())
                .checkVariableSymbol(formData.getVariableSymbol())
                .checkConstantSymbol(formData.getConstantSymbol())
                .checkSpecificSymbol(formData.getSpecificSymbol())
                .checkRecipientMessage(formData.getRecipientMessage())
                .checkMyNote(formData.getMyNote())
                .checkNoMobileKeyIsNeeded()
                .clickContinueMobileKey();
    }

    public Function<DashboardPage, NewForeignPaymentPage> foreignPaymentBankNotAcceptingTheGivenCurrency(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientName(formData.getRecipientName())
                .checkBic(formData.getBankCodeBic())
                .checkBankName(formData.getBankNameAddress())
                .checkStreet(formData.getRecipientBankAddressStreet())
                .checkCity(formData.getRecipientBankCity())
                .checkCountry(formData.getBankCountry())
                .clickContinueAndStayOnSamePage()
                .checkValidationCurrencyIsNotAccepted(formData.getValidationCurrency());
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> bicContainsTheCountryOfTheRecipientBank(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientBankBic(formData.getBankCodeBic())
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .checkBankName(formData.getBankNameAddress())
                .checkCity(formData.getRecipientBankCity())
                .checkCountry(formData.getBankCountry())
                .checkDisabledRecipientBankCountryButton()
                .clickOnContinue();
    }

    public Function<DashboardPage, NewPaymentDomesticPage> foreignCzkPaymentFromCzkAccountToCzBank(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .checkModalCzkToCzk()
                .clickOnForeignToDomesticButton()
                .checkDestinationAccountNumber("1234567899")
                .checkDestinationAccountBank("0800");
    }

    public Function<DashboardPage, DashboardPage> setPaymentOverLimit(PaymentFormData formData) {
        return start -> start.clickPayment()
                .fillNumberOfAccount(formData.getRecipientAccountNumber())
                .fillBankCode(formData.getBankCode())
                .fillAmount(formData.getAmount())
                .fillVariableSymbol(formData.getVariableSymbol())
                .fillConstantSymbol(formData.getConstantSymbol())
                .fillSpecificSymbol(formData.getSpecificSymbol())
                .fillRecipientMessage(formData.getRecipientMessage())
                .scrollToBottom()
                .clickContinue()
                .checkAlertOverLimit(formData.getCategory())
                .clickOnBack()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumberEur())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientName(formData.getRecipientName())
                .scrollToBottom()
                .clickOnContinue()
                .checkAlertOverLimit(formData.getCategory())
                .goToDashboard();
    }

    public Function<AuthMobileKey, CardsPage> smsKeyAuthorizationPopup() {
        return start -> start.typeSmsKey(DEFAULT_MOBILE_KEY)
                .clickSend()
                .onCardsPage();
    }

    public Function<DashboardPage, CardsPage> getIntoBlockingScreen(String maskedCardNumber, String cardDetailInfo) {
        return start -> start.clickCards()
                .openCardsSubMenu()
                .selectCard(maskedCardNumber)
                .clickDetailsAndSettings()
                .checkCardDetailInfo(cardDetailInfo)
                .clickOnBlockCancelCard();
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> foreignPaymentMandatoryIban(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientBankBic(formData.getBankCodeBic())
                .checkBic(formData.getBankCodeBic())
                .checkBankName(formData.getBankNameAddress())
                .checkStreet(formData.getRecipientBankAddressStreet())
                .checkCity(formData.getRecipientBankCity())
                .checkCountry((formData.getBankCountry()))
                .setRecipientName(formData.getRecipientName())
                .clickContinueAndStayOnSamePage()
                .checkErrorIban(formData.getErrorIban())
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .clickBankCountryValue()
                .checkBicDisabled()
                .checkRecipientBankNameDisabled()
                .checkRecipientBankAddressStreetDisabled()
                .checkRecipientBankAddressCityDisabled()
                .checkDisabledRecipientBankCountryButton()
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue();
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> priorityForeignPayment(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setTypeOfPayment(formData.getTypeOfPayment())
                .setRecipientBankBic(formData.getBankCodeBic())
                .checkFeeForeignPriorityPayment(formData.getFeeForeignPriorityPayment())
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue()
                .checkFeeForeignPriorityPaymentSummary(formData.getFeeForeignPriorityPaymentSummary())
                .checkFeeType(formData.getFeeType());
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> sepaConfirmation(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue();
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> foreignOrderConfirmation(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue();
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> prioritySepaPayment(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .checkDisabledChargeBearerButton()
                .setTypeOfPayment(formData.getTypeOfPayment())
                .checkFeeForeignPriorityPayment(formData.getFeeForeignPriorityPayment())
                .checkChargeBearerValue(formData.getChargeBearerValue())
                .checkBicDisabled()
                .checkRecipientBankNameDisabled()
                .checkRecipientBankAddressStreetDisabled()
                .checkRecipientBankAddressCityDisabled()
                .checkDisabledRecipientBankCountryButton()
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue()
                .checkFeeForeignPriorityPaymentSummary(formData.getFeeForeignPriorityPaymentSummary())
                .checkFeeType(formData.getFeeType());
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> foreignPaymentFeeCalculatorAndExchangeRateDifference(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .checkEstimatedAmountCurrency(formData.getEstimatedAmountCurrency())
                .checkSubmitSourceCurrency(formData.getSubmitSourceCurrency())
                .checkConversionFeeCurrency(formData.getConversionFeeCurrency())
                .checkPaymentFeeCurrency(formData.getPaymentFeeCurrency())
                .checkChargeBearerValue(formData.getChargeBearerValue())
                .checkTooltipFees()
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue()
                .checkFeeType(formData.getFeeType());
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> sepaPaymentFeeCalculatorAndExchangeRateDifference(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .checkEstimatedAmountCurrency(formData.getEstimatedAmountCurrency())
                .checkSubmitSourceCurrency(formData.getSubmitSourceCurrency())
                .checkConversionFeeCurrency(formData.getConversionFeeCurrency())
                .checkPaymentFeeCurrency(formData.getPaymentFeeCurrency())
                .checkDisabledChargeBearerButton()
                .checkChargeBearerValue(formData.getChargeBearerValue())
                .setRecipientName(formData.getRecipientName())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue()
                .checkFeeType(formData.getFeeType());
    }

    public Function<DashboardPage, NewForeignPaymentSummaryPage> sepaPaymentMandatoryIbanToCountriesInTheIbanCodeList(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientBankBic(formData.getBankCodeBic())
                .checkBankName(formData.getBankNameAddress())
                .checkStreet(formData.getRecipientBankAddressStreet())
                .checkCity(formData.getRecipientBankCity())
                .checkCountry((formData.getBankCountry()))
                .setRecipientName(formData.getRecipientName())
                .clickContinueAndStayOnSamePage()
                .checkErrorIban(formData.getErrorIban())
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setRecipientAddressCountry(formData.getRecipientAddressCountry())
                .checkChargeBearerValue(formData.getChargeBearerValue())
                .checkDisabledChargeBearerButton()
                .checkSepaAlert()
                .setRecipientMessage(formData.getRecipientMessage())
                .clickOnPaymentConfirmationEmailCheckbox()
                .setConfirmationEmail(formData.getConfirmationEmail())
                .clickOnContinue()
                .clickOnEdit()
                .fillChangedRecipientAccountNumber(formData.getChangedRecipientAccountNumber())
                .clickOnAmount()
                .checkEnabledChargeBearerButton()
                .checkBicEnabled()
                .checkRecipientBankNameEnabled()
                .checkRecipientBankAddressStreetEnabled()
                .checkRecipientBankAddressCityEnabled()
                .checkEnabledRecipientBankCountryButton()
                .clickContinueAndStayOnSamePage()
                .checkRecipientIbanErrorMessage()
                .fillRecipientAccountNumber(formData.getRecipientAccountNumber())
                .clickOnAmount()
                .checkDisabledChargeBearerButton()
                .checkBicDisabled()
                .checkRecipientBankNameDisabled()
                .checkRecipientBankAddressStreetDisabled()
                .checkRecipientBankAddressCityDisabled()
                .checkDisabledRecipientBankCountryButton()
                .checkRecipientName()
                .clickOnContinue();
    }

    public Function<DashboardPage, NewForeignPaymentPage> foreignPaymentAllCurrenciesWithinTheEeaWithShaFeeOnly(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientName(formData.getRecipientName())
                .checkChargeBearerValue(formData.getChargeBearerValue())
                .checkDisabledChargeBearerButton()
                .scrollToTop()
                .setCurrency("CAD")
                .checkChargeBearerValue(formData.getChargeBearerValue())
                .checkEnabledChargeBearerButton()
                .scrollToTop()
                .setFees(formData.getFees())
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees("OUR")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("CHF")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees(formData.getFees())
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("CZK")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees("OUR")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("DKK")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees(formData.getFees())
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("GBP")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees("OUR")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("HUF")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees(formData.getFees())
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("JPY")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees("OUR")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("NOK")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees(formData.getFees())
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("PLN")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees("OUR")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("RON")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees(formData.getFees())
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("SEK")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees("OUR")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setCurrency("USD")
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage()
                .scrollToTop()
                .setFees(formData.getFees())
                .clickContinueAndStayOnSamePage()
                .checkChargeBearerErrorMessage();
    }

    public Function<DashboardPage, NewForeignPaymentVictoryPage> foreignPaymentAllCurrenciesOutsideTheEeaWithAnyFee(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .setCurrency(formData.getCurrency())
                .setRecipientBankBic(formData.getBankCodeBic())
                .setRecipientName(formData.getRecipientName())
                .checkChargeBearerValue(formData.getChargeBearerValue())
                .checkEnabledChargeBearerButton()
                .scrollToTop()
                .setCurrency("CAD")
                .checkChargeBearerValue(formData.getChargeBearerValue())
                .checkEnabledChargeBearerButton()
                .setFees(formData.getFees())
                .checkAlertAmountMustBeHigher()
                .setFees("OUR")
                .clickOnContinue()
                .clickOnEdit()
                .setCurrency(formData.getCurrency())
                .clickOnContinue()
                .clickOnEdit()
                .setFees(formData.getFees())
                .checkAlertAmountMustBeHigher()
                .setCurrency("PLN")
                .checkAlertAmountMustBeHigher()
                .setFees("OUR")
                .clickOnContinue()
                .clickOnEdit()
                .setCurrency("USD")
                .setFees(formData.getFees())
                .checkAlertAmountMustBeHigher()
                .setFees("OUR")
                .clickOnContinue()
                .checkToAccount(formData.getRecipientAccountNumber())
                .checkAmount(formData.getAmount())
                .checkCurrency("USD")
                .checkTypeOfCharge("OUR")
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkForeignPaymentVictoryText();
    }

    public Function<DashboardPage, NewForeignPaymentVictoryPage> foreignPaymentPaymentStatusInCaseOfNsfEur(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setCurrency(formData.getCurrency())
                .setRecipientAccountNumber(formData.getRecipientAccountNumber())
                .setAmount(formData.getAmount())
                .checkBic(formData.getBankCodeBic())
                .checkAlertOverdraft()
                .checkBankName(formData.getBankNameAddress())
                .checkStreet(formData.getRecipientBankAddressStreet())
                .checkCity(formData.getRecipientBankCity())
                .checkCountry((formData.getBankCountry()))
                .setRecipientName(formData.getRecipientName())
                .clickOnContinue()
                .checkCurrency(formData.getCurrency())
                .checkTypeOfCharge(formData.getTypeOfCharge())
                .checkBankCode(formData.getBankCodeBic())
                .checkBankCountry(formData.getBankCountry())
                .checkNameAddressOfBank(formData.getBankNameAddress())
                .checkRecipientName((formData.getRecipientName()))
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkForeignPaymentVictoryText();
    }

    public Function<DashboardPage, NewForeignPaymentVictoryPage> foreignPaymentPaymentStatusInCaseOfNsfCad(PaymentFormData formData) {
        return start -> start.clickPayment()
                .clickOnForeignTab()
                .setCurrency("CAD")
                .setRecipientAccountNumber("123456789")
                .setAmount(formData.getAmount())
                .clickOnInvalidIbanModal()
                .setRecipientBankBic("IRVTUS3NXXX")
                .checkAlertOverdraft()
                .checkBankName("THE BANK OF NEW YORK MELLON")
                .checkStreet("240 GREENWICH STREET")
                .checkCity("NEW YORK")
                .checkCountry("US - USA")
                .setRecipientName(formData.getRecipientName())
                .clickOnContinue()
                .checkCurrency("CAD")
                .checkTypeOfCharge(formData.getTypeOfCharge())
                .checkBankCode("IRVTUS3NXXX")
                .checkBankCountry("US - USA")
                .checkNameAddressOfBank("THE BANK OF NEW YORK MELLON")
                .checkRecipientName(formData.getRecipientName())
                .clickOnConfirm()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkForeignPaymentVictoryText();
    }

    public Function<DashboardPage, AccountsPage> downloadCashReceipts(PaymentFormData formData) {
        return start -> start.goToAccounts()
                .selectAccountNumber(formData.getFromAccountNumber())
                .openTransactionDetails(formData.getRecipientAccountNumberCzk())
                .clickOnDownloadCashReceipt();
    }

    public Function<DashboardPage, StandingOrderVictoryPage> establishmentBuildingSavings(SavingsFormData formData) {
        return start -> start.goToSavings()
                .clickOnBuildingSavingsButton()
                .checkBuildingSavingsText()
                .checkMonthlyPaymentDefault()
                .checkMonthlyPaymentMaxAlert()
                .setMonthlyPayment(formData.getMinMonthlyPayment())
                .checkMonthlyPaymentMinAlert()
                .setMonthlyPayment(formData.getMaxMonthlyPayment())
                .checkMonthlyPaymentMaxAlert()
                .clickOnTargetAmount()
                .checkTargetAmountOverall("5 231 000")
                .setMonthlyPayment(formData.getDefaultMonthlyPayment())
                .clickOnCheckboxStateContribution()
                .clickOnCheckboxStateContribution()
                .clickOnContinue()
                .checkTitleBuildingSavings()
                .checkTitlePersonalDetail()
                .checkFirstNameLabel()
                .checkLastNameLabel()
                .checkPhoneNumberLabel()
                .checkEmailLabel()
                .checkNationalityLabel()
                .checkBirthStateLabel()
                .checkBackButton()
                .clickOnContinue()
                .checkTitleBuildingSavings()
                .checkTitlePersonalDetailAddress()
                .checkPermanentAddressFormStreetLabel()
                .checkPermanentAddressFormDescriptiveNumberLabel()
                .checkPermanentAddressFormOrientationNumberLabel()
                .checkPermanentAddressFormTownLabel()
                .checkPermanentAddressFormZipLabel()
                .checkPermanentAddressFormCountryLabel()
                .checkCheckboxContactAndPermanentAddress()
                .clickOnCheckboxContactSameAsPermanent()
                .checkTitleContactAddress()
                .clickOnCheckboxContactSameAsPermanent()
                .checkBackButton()
                .clickOnSubmit()
                .checkAmlQuestionnaire()
                .checkTitleBuildingSavings()
                .checkAmlBuildingSavingsText()
                .clickOnAmlDepositOrigin()
                .clickOnAmlWayOfSavings()
                .clickOnAmlRangeOfIncomeValue()
                .clickOnAmlCzOnlyTaxResidenceLabel()
                .checkBackButton()
                .clickOnConfirmButton()
                .checkTitleBuildingSavings()
                .checkPreContractualInformationTitle()
                .scrollToBottom()
                .checkAgreementText()
                .clickOnAgreementCheckbox()
                .checkDeclineButton()
                .clickGoNextButton()
                .checkDeclineButton()
                .clickOnUnderstandAndAgreeButton()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkVictoryText()
                .clickSetStandingOrderButton()
                .checkDestinationAccNumber()
                .checkDestinationAccBank()
                .checkAmount("1 700")
                .checkFrequency()
                .checkOrderNoteForRecipient()
                .clickOnContinueButtonStandingOrder()
                .clickOnConfirmButtonStandingOrder()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkStandingOrderVictoryText();
    }

    public Function<DashboardPage, NewPaymentMenuPage> checkNoSipo() {
        return start -> start.clickPayment()
                .clickMore()
                .checkNoSipo();
    }

    public Function<DashboardPage, RtvServicingPage> rtvServicingDeposit(SavingsFormData formData) {
        return start -> start.goToDashboard()
                .clickOnRtvCard(formData.getAccountNumberRtvServicingDeposit() + "/0600")
                .clickOnRtvDepositButton()
                .checkRtvDepositTitle()
                .checkRtvDepositSourceAccountLabel()
                .checkRtvSourceAccountNumberDeposit(formData.getDestinationAccountNumberDeposit())
                .checkRtvDepositTemplateLabel()
                .checkRtvDestinationAccountPrefixLabel()
                .checkRtvDestinationAccountNumberLabel()
                .checkRtvDepositDestinationAccountNumber(formData.getAccountNumberRtvServicingDeposit())
                .checkRtvDestinationAccountBankLabel()
                .checkRtvDepositAmountLabel()
                .checkRtvDepositText()
                .checkRtvDueDateLabel()
                .checkRtvDueDateFieldDisabled()
                .checkRtvChangeToOtherDate()
                .fillDepositAmount("10000")
                .clickOnContinue()
                .checkRtvServicingContractTitle()
                .clickOnSignButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkRtvServicingVictoryText()
                .clickBackToDashboard()
                .clickOnRtvCard(formData.getAccountNumberRtvServicingDeposit() + "/0600")
                .checkRtvDepositYellowAlertText()
                .checkRtvDepositBlueAlertText()
                .clickOnStornoButton()
                .checkRtvStornoTitle()
                .clickOnSignButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkRtvStornoVictoryText();
    }

    public Function<DashboardPage, RtvServicingPage> rtvServicingWithdrawal(SavingsFormData formData) {
        return start -> start.goToDashboard()
                .clickOnRtvCard(formData.getAccountNumberRtvServicingWithdrawal() + "/0600")
                .clickOnRtvWithdrawalButton()
                .checkRtvWithdrawalTitle()
                .checkRtvWithdrawalSourceAccountLabel()
                .checkRtvSourceAccountNumberWithdrawal(formData.getSourceNumberRtvServicingWithdrawal())
                .checkRtvWithdrawalTemplateLabel()
                .checkRtvDestinationAccountPrefixLabel()
                .checkRtvDestinationAccountNumberLabel()
                .checkRtvDepositDestinationAccountNumber(formData.getDestinationAccountRtvServicingWithdrawal())
                .checkRtvDestinationAccountBankLabel()
                .checkRtvWithdrawalAmountLabel()
                .checkRtvDueDateLabel()
                .checkRtvDueDateFieldDisabled()
                .checkRtvChangeToOtherDate()
                .fillWithdrawalAmount("10000")
                .clickOnContinue()
                .checkRtvServicingContractTitle()
                .clickOnSignButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkRtvServicingVictoryText()
                .clickBackToDashboard()
                .clickOnRtvCard(formData.getAccountNumberRtvServicingWithdrawal() + "/0600")
                .checkRtvWithdrawalBlueAlertText()
                .clickOnStornoButton()
                .checkRtvStornoTitle()
                .clickOnSignButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkRtvStornoVictoryText();
    }

    public Function<DashboardPage, RtvServicingPage> rtvServicingCancel(SavingsFormData formData) {
        return start -> start.goToDashboard()
                .clickOnRtvCard(formData.getAccountNumberRtvServicingCancel() + "/0600")
                .clickOnRtvCancelButton()
                .checkRtvCancelTitle()
                .checkRtvWithdrawalSourceAccountLabel()
                .checkRtvSourceAccountNumberWithdrawal(formData.getSourceNumberRtvServicingCancel())
                .checkRtvWithdrawalTemplateLabel()
                .checkRtvDestinationAccountPrefixLabel()
                .checkRtvDestinationAccountNumberLabel()
                .checkRtvDepositDestinationAccountNumber(formData.getDestinationAccountRtvServicingCancel())
                .checkRtvDestinationAccountBankLabel()
                .checkRtvWithdrawalAmountLabel()
                .checkRtvDueDateLabel()
                .checkRtvDueDateFieldDisabled()
                .checkRtvChangeToOtherDate()
                .checkRtvCancelAmount()
                .clickOnContinueRtvServicingCancelButton()
                .checkRtvServicingContractTitle()
                .clickOnSignButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkRtvServicingVictoryText()
                .clickOnRtvServicingStornoButtonOnVictory()
                .checkRtvStornoTitle()
                .clickOnSignButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkRtvStornoVictoryText();
    }

    public Function<DirectDebitsPage, DirectDebitsPage> deleteDirectDebitFromSettings(PaymentFormData formData) {
        return start -> start.confirmDeleteDirectDebit()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkDeleteDirectDebitVictoryText()
                .clickOnBackToDirectDebitsPage();
    }

    public Function<DirectDebitsPage, DirectDebitsPage> changeDirectDebitFromSettings(PaymentFormData formData) {
        return start -> start.clickOnChangeDirectDebit(formData.getDirectDebitName())
                .setDirectDebitName(formData.getDirectDebitName() + "Ch")
                .setAmountLimit("200,00")
                .confirmChangeDirectDebit()
                .checkDirectDebitName(formData.getDirectDebitName() + "Ch")
                .checkDirectDebitLimit("200,00")
                .confirmChangeDirectDebit()
                .setMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkChangeDirectDebitVictoryText()
                .clickOnBackToDirectDebitsPage()
                .sleepRefreshAndCloseCookiesIfVisible(formData.getDirectDebitName() + "Ch", formData.getFromAccountNumber(), "200,00");
    }

    public Function<DashboardPage, ChangePasswordPage> changePasswordSettings() {
        return start -> start.clickOnSettings()
                .clickOnChangePasswordButton()
                .checkPasswordConditions()
                .fillNewPassword("Bb123456")
                .fillNewPasswordAgain("Cc123456")
                .clickOnPasswordField()
                .checkIdenticalPasswordValidation()
                .fillNewPassword("Aa123456")
                .fillNewPasswordAgain("Aa123456")
                .clickOnContinue()
                .checkAlreadyUsedPasswordValidation()
                .fillNewPassword("Bb123456")
                .fillNewPasswordAgain("Bb123456")
                .clickOnContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkVictoryTitleAndText()
                .clickOnBackToSettingsButton()
                .clickOnChangePasswordButton()
                .fillNewPassword("Cc123456")
                .fillNewPasswordAgain("Cc123456")
                .clickOnContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .clickOnBackToSettingsButton()
                .clickOnChangePasswordButton()
                .fillNewPassword("Dd123456")
                .fillNewPasswordAgain("Dd123456")
                .clickOnContinue()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey();
    }

    public Function<DashboardPage, AccountsSettingsPage> checkAccountsSettings(PaymentFormData formData, String accountType, String accountTestName) {
        return start -> start.clickOnSettings()
                .clickOnAccounts(accountType)
                .clickOnAccount()
                .checkAccountName(accountTestName)
                .checkAccountNumber(formData.getFromAccountNumber() + "/0600")
                .checkIban(formData.getIban())
                .checkBic("AGBACZPP")
                .checkAccountType(formData.getFromAccountType())
                .checkStatementFrequency("Měsíční")
                .checkStatementDistribution("Poštou")
                .clickOnChangeName()
                .typeIntoName("Changed")
                .saveAccountName()
                .checkAccountName("Changed")
                .clickOnChangeStatementFrequency()
                .checkStatementTitle("Changed - Nastavení výpisů")
                .clickOnBack()
                .clickOnAccount()
                .clickOnChangeStatementDistribution()
                .checkStatementTitle("Changed - Nastavení výpisů")
                .clickOnBack()
                .clickOnAccount()
                .clickOnSetAsPreferred()
                .clickOnConfirm()
                .checkSetAsPreferredTitle()
                .clickOnConfirm()
                .checkPreferredAccount()
                .clickOnChangeName()
                .typeIntoName(accountTestName)
                .saveAccountName()
                .checkAccountName(accountTestName)
                .clickOnCloseAccount()
                .checkCloseAccountTitle();
    }

    public Function<DashboardPage, CardsSettingsPage> cardsSettingsTest() {
        return start -> start.clickOnSettings()
                .clickOnCards()
                .clickOnCreditCardsTab()
                .checkNoCreditCards()
                .clickOnDebitCardsTab()
                .clickOnDebitCardsToTheAccount()
                .clickOnCardsToTheAccount()
                .clickOnCardDetail()
                .checkCardDetailTitle()
                .checkCardDetailFull()
                .checkDccAlert()
                .clickOnAdjustSettings()
                .checkOnlinePaymentTitle()
                .checkLabelInternetAndMotoPayments()
                .clickOnInternetAndMotoPaymentsTurnOn()
                .clickOnDccTurnOff()
                .fillAtmWithdrawalLimit("150001")
                .fillOnlinePaymentsLimit("150001")
                .fillPaymentsInStoresLimit("150001")
                .clickOnContinue()
                .checkValidationMessageAtmLimit()
                .checkValidationMessageOnlinePaymentsLimit()
                .checkValidationPaymentsInStoresLimit()
                .fillAtmWithdrawalLimit("150000")
                .fillOnlinePaymentsLimit("150000")
                .fillPaymentsInStoresLimit("150000")
                .clickOnContinue()
                .checkSummaryTitle()
                .checkSummaryInternetAndMotoPaymentsLabel("Ano")
                .checkSummaryDcc("Ne")
                .checkSummaryAtmWithdrawalLimit()
                .checkSummaryOnlinePaymentsLimit()
                .checkSummaryInternetAndMotoPaymentsLimit()
                .clickOnSummaryAcceptButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkVictoryTitle()
                .clickBackToCardsButton()
                .clickOnDebitCardsToTheAccount()
                .clickOnCardsToTheAccount()
                .clickOnCardDetail()
                .clickOnAdjustSettings()
                .clickOnInternetAndMotoPaymentsTurnOff()
                .clickOnDccTurnOn()
                .clickOnContinue()
                .checkSummaryInternetAndMotoPaymentsLabel("Ne")
                .checkSummaryDcc("Ano")
                .clickOnSummaryAcceptButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkVictoryTitle();
    }

    public Function<DashboardPage, CardsSettingsPage> cardsSettingsTemporaryBlockingTest() {
        return start -> start.clickOnSettings()
                .clickOnCards()
                .clickOnDebitCardsToTheAccount()
                .clickOnCardsToTheAccount()
                .clickOnCardDetail()
                .clickOnBlockAndCancelCardButton()
                .checkBlockCardTitle()
                .checkCardBlockingTypeTitle()
                .checkCardBlockingTypes()
                .checkCardBlockingTypesDetails()
                .checkOtherSettingsTitle()
                .checkSendSmsText()
                .clickOnBlockAndNewOne()
                .checkReasonForBlockingTitle()
                .checkTheftCard()
                .checkLossCard()
                .clickOnBlockAndCancel()
                .clickOnTemporarilyBlock()
                .clickOnSmsToggle()
                .clickOnContinueBlockingCardButton()
                .checkValidationMessage("Neplatný formát telefonního čísla")
                .fillUnblockMobileNumber("111111111")
                .clickOnContinueBlockingCardButton()
                .checkValidationMessage("Zkontrolujte zadaný formát telefonního čísla.")
                .fillUnblockMobileNumber("702111111")
                .clickOnContinueBlockingCardButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkBlockCardTitle()
                .checkCardBlockingVictoryTitle()
                .checkCardBlockingVictoryText()
                .clickOnBackButtonOnVictoryScreen()
                .clickOnUnblockButton()
                .checkCardBlockingTypesOnUnblockScreen()
                .clickOnContinueBlockingCardButton()
                .fillMobileKey(DEFAULT_MOBILE_KEY)
                .clickOnContinueMobileKey()
                .checkBlockCardTitle()
                .checkCardUnblockingVictoryTitle()
                .checkCardUnblockingVictoryText();
    }

    public Function<DashboardPage, DisponentsSettingsPage> checkDisponentsViaSettings() {
        return start -> start.clickOnSettings()
                .clickOnDisponents()
                .checkName()
                .checkRole()
                .checkStatus();
    }

    public Function<DashboardPage, CardsSettingsPage> creditCardsSettingsTest() {
        return start -> start.clickOnSettings()
                .clickOnCards()
                .clickOnCreditCardsTab()
                .clickOnCreditCard()
                .checkCreditCardDetailTitle()
                .checkCreditCardDetailFull()
                .checkDccAlert()
                .checkCreditCardBalancesAndLimitDetail()
                .checkCreditCardBenefitPackagesTitle()
                .checkCreditCardBenefitPackagesDetail()
                .clickOnCreditLimitIncreaseButton()
                .checkCreditLimitIncreaseModal()
                .clickOnCreditLimitIncreaseCloseModalButton();
    }

    public Function<DashboardPage, AdvicePage> adviceFopTest() {
        return start -> start.goToAccounts()
                .clickOnAdviceButton()
                .checkPaymentReference()
                .checkAmount()
                .clickOnPreviewOfAdvice()
                .checkTitleAdvice()
                .checkDownloadButton()
                .checkPrintButton()
                .clickOnCloseButton();
    }

    public Function<DashboardPage, AdvicePage> adviceFonTest() {
        return start -> start.goToAccounts()
                .clickOnAdviceButton()
                .checkPaymentReference()
                .checkAmount()
                .clickOnPreviewOfAdvice()
                .checkTitleAdvice()
                .checkDownloadButton()
                .checkPrintButton()
                .clickOnCloseButton()
                .fillInDate("1.12.2025")
                .fillToDate("15.1.2026")
                .clickOnShowMoreAdvices();
    }

    public Function<DashboardPage, DpsPage> dpsDisplayedOntheDashboardAndInTheSavingsSection() {
        return start -> start
                .checkPensionCardTitle()
                .checkPensionCardSavedText()
                .goToSavings()
                .clickOnPensionButton()
                .checkChangeContributionButton()
                .checkChangeStrategyButton()
                .checkOverviewText()
                .checkQuickOverviewText()
                .checkAllocationIntoFundsText()
                .clickOnTabDocuments()
                .checkYourDocuments()
                .checkFundInformation()
                .clickOnTabFaq()
                .clickOnFaqQuestion()
                .checkFaqAnswer()
                .clickOnContacts()
                .checkContactsText()
                .checkPhoneNumber()
                .checkEmail()
                .checkMeeting();
    }

    public Function<DashboardPage, SuccessfullyLogoutPage> loginLogoutNewIb() {
        return start -> start
                .clickLogout()
                .denyLogout()
                .clickLogout()
                .clickYesLogout()
                .checkLogoutText();
    }

    public Function<DashboardPage, LoginPage> loginLogoutAfterSessionTimeoutNewIb() {
        return start -> start
                .waitFourMinutesToLogoutPopup()
                .clickOnContinueWorking()
                .waitFourMinutesToLogoutPopup()
                .clickOnStopWorking()
                .checkLogoutText()
                .closeCookiesPanelIfVisible()
                .clickOnBackToLogin()
                .clickLoginWithIdAndPassword();
    }

    public Function<DashboardPage, DpsPage> dpsChangeOfContributionAndDeposit() {
        return start -> start.goToSavings()
                .clickOnPensionButton()
                .clickOnContributionsAndDepositsButton()
                .fillDeposit("16000")
                .clickOnHasEmployerContributionCheckbox()
                .clickOnContinueButton()
                .clickOnContinueButton()
                .clickOnDpsSourceOfIncome()
                .selectDpsSourceOfIncome()
                .clickOnDpsIncome()
                .selectDpsIncome()
                .checkPayTaxes()
                .checkNotPepPerson()
                .checkNotGreenCardHolder()
                .clickOnContinueButton()
                .clickOnContinueToSignatureButton()
                .checkContractTitle()
                .clickOnAgreeContinuebutton()
                .fillMobileKey("12341234")
                .clickContinueMobileKey()
                .clickOnStandingOrderButton()
                .clickOnCloseSettingsButton()
                .clickOnBackToDashboardButton()
                .checkContributionsAndDepositsAlert();
    }

    public Function<DashboardPage, AdvicePage> adviceOnTheTransactionDetailFonTest() {
        return start -> start.goToAccounts()
                .clickOnAdviceButton()
                .clickOnGraphsTab()
                .clickOnPlannedTab()
                .clickOnStatementsTab()
                .clickOnHistoryTab()
                .clickOnAdvancedSearch()
                .clickOnPaymentType()
                .clickPaymentTypeOption("Zahraniční platba")
                .clickOnAdvancedFilterSearchButton()
                .clickOnTransaction("CZ62510007547061")
                .clickOnAdviceButton();
    }

    public Function<DashboardPage, MessagesModalPage> receivedMessagesTest() {
        return start -> start.goToMessagesAndNotification()
                .checkTooltip()
                .clickOnUnreadMessages()
                .clickOnSentMessages()
                .clickOnInboxMessages()
                .checkSubjectOfTheReceivedMessage()
                .clickOnReceivedMessage()
                .checkTextOfTheReceivedMessage()
                .checkViewPreviousCommunication()
                .clickOnAnswerButton()
                .checkTitleNewMessage();
    }

    public Function<DashboardPage, MessagesModalPage> sendingAmessageToTheBankTest(String lastMessageSubject) {
        return start -> start.goToMessagesAndNotification()
                .checkTooltip()
                .clickOnNewMessage()
                .checkTitleTopic("Účty")
                .setSubject("Test")
                .setTopic("Hypotéky")
                .setMessage("Test OK.")
                .clickOnSendMessage()
                .checkMessageSentVictoryText()
                .clickOnBackToMessages()
                .clickOnSentMessages()
                .clickOnSentMessage(lastMessageSubject)
                .clickOnDeleteButton()
                .checkDeleteMessageTitle()
                .clickOnConfirmDeleteMessage()
                .checkConfirmDeleteModal()
                .clickOnCloseConfirmDeleteButton()
                .clickOnNewMessage()
                .setSubject("Test")
                .setTopic("Reklamace a stížnosti")
                .setTypeOfComplaintsAndClaims("Produkty a služby")
                .setMessage("Test OK.")
                .clickOnSendMessage()
                .checkMessageSentVictoryTitle()
                .clickOnNewMessage()
                .setTopic("Nadlimitní výběr")
                .checkSubjectOverdraftDisabled()
                .setBranch("Praha 4, Vyskočilova 1442/1b, 14000")
                .setAmount("100000")
                .setWithdrawalDate("31.12.2030")
                .setClientPhoneNumber("702777777")
                .setMessage("Test")
                .clickOnAgreement()
                .clickOnSendMessage()
                .checkMessageSentVictoryTitle()
                .clickOnNewMessage()
                .setSubject(lastMessageSubject)
                .setTopic("Zahraniční platby upřesnění/zrušení")
                .setIban("1111")
                .setAmount("100")
                .setCurrency("CZK")
                .setDueDate("31.12.2030")
                .setMessage("Test")
                .clickOnAgreement()
                .clickOnSendMessage()
                .checkMessageSentVictoryTitle()
                .checkMessageSentVictoryText()
                .clickOnBackToMessages()
                .clickOnSentMessages()
                .clickOnSentMessage(lastMessageSubject);
    }

    public Function<DashboardPage, DocumentsModalPage> documentsOverviewTest() {
        return start -> start.goToDocuments()
                .checkDocumentName("Záznam o podané reklamaci/stížnosti")
                .clickOnLink()
                .clickOnDocument("Záznam o podané reklamaci/stížnosti")
                .checkOpenDocumentTitle()
                .checkPrintButton()
                .checkDownloadButton();
    }
}