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.auth.Key;
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 SEPA payment")
public class TemplateForeignSEPA {

    @Disabled
    @TestCase(name = "Go to templates page and create template of SEPA payment", environments = {TST1, PPE})
    @JiraTestCase(id = "IB-T8254")
    void userWithCurrentAccount_shouldCreateTemplateSepaPayment(Harness harness, @Key("ib.client") Credentials credentials) {
        harness.withIB()
                .openLoginPage()
                .then(harness.tasks().ib().loginWithDefaultMobileKeyAnd(credentials))
                .clickAccountsAndTransactions()
                .clickTemplatesSetting()
                .clickNewTemplate()
                .clickTypeSepaPayment()
                .fillTemplateName(harness.generate(GeneratorType.ICO))
                .clickAccountSepaSelect()
                .fillSepaAmount("1")
                .fillSepaIban("DE89 3704 0044 0532 0130 00")
                .fillSepaPayeeName("Testovaci Klient")
                .fillSepaPayeeAddress("KAISERSTRASSE 16")
                .fillSepaPayeeAddress2("60261 FRANKFURT AM MAIN")
                .clickSepaCountryPayee()
                .fillSepaRecipientMsg("testovaci Platba SEPA")
                .fillSepaReference("popis")
                .clickNextButton()
                .typeSmsCode("12341234")
                .clickSendButton()
                .clickTemplateOverview();
    }
}
