package cz.moneta.test.regression.channels.digital.sb;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.mobile.smartbanking.landing.SmartBankingLoginKeyboard;
import cz.moneta.test.dsl.mobile.smartbanking.payment.Payment;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;

import static cz.moneta.test.dsl.mobile.smartbanking.landing.SmartBankingLoginKeyboard.*;

@TestScenario(name = "Mobile scenario")
public class MobileTest {

    @TestCase(name = "Mobile test")
    public void createPayment(Harness harness) {
        Payment payment = new Payment();
        SmartBankingLoginKeyboard[] pin = {KEY_1, KEY_2, KEY_3, KEY_4};

        harness.withSB()
                .onLandingPage()
                .enterPinUsingKeyboard(harness, pin)
                .onBalanceView()
                .openMenu()
                .currentAccountsUserHasOneAccount()
                //.clickOnAccount(harness, payment) use this method if user has more than one account
                .payment()
                .setPaymentDestinationData(payment.getToAccountNumber(), payment.getBankCode())
                .continueButton()
                .setPaymentData(payment.getAmount(), payment.getVariableSymbol())
                .continueButton()
                .checkPaymentData(harness, payment)
                .certifyButton()
                .enterPinUsingKeyboard(harness, pin)
                .onSentPaymentView();
    }
}