package cz.moneta.test.regression.channels.digital.ib.oldib.templates;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import cz.moneta.test.harness.support.auth.Credentials;

import cz.moneta.test.harness.support.data.GeneratorType;
import org.junit.jupiter.api.Disabled;

import static cz.moneta.test.harness.annotations.Environment.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;

@TestScenario(name = "Verify Create Template foreign payment between own accounts")
public class TemplateForeignBetweenOwnAccounts {

    @Disabled
    @TestCase(name = "Go to templates page and create template foreign payment between own accounts", environments = {TST1, PPE})
    @JiraTestCase(id = "IB-T8256")
    void userWithCurrentAccount_shouldCreateTemplateBetweenOwnAccounts(Harness harness) {
        String rcOfClientWithTwoCZKacc = harness.getConfig("IB.rc.user-with-CZK-and-EUR-account");

        Credentials udebsCredentials = harness.withUdebs()
                .ib()
                .usernameAndPassword()
                .getUsernameAndPasswordByRc(rcOfClientWithTwoCZKacc);

        harness.withIB()
                .openLoginPage()
                .then(harness.tasks().ib().loginWithDefaultMobileKeyAnd(udebsCredentials))
                .clickAccountsAndTransactions()
                .clickTemplatesSetting()
                .clickNewTemplate()
                .clickTypeOwnPayment()
                .fillTemplateName(harness.generate(GeneratorType.ICO))
                .clickAccountOwnSelect()
                .clickSecondOwnAccount()
                .fillTemplateAmount("1")
                .clickCurrencyOwnSelect()
                .clickDetailUrl()
                .fillRecipientMsg("Šablona cizoměnové platby mezi vlastními účty")
                .clickNextButton()
                .typeSmsCode("12341234")
                .clickSendButton()
                .clickTemplateOverview();
    }
}

