package cz.moneta.test.regression.channels.branch.archive;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.ufo.banka.tasks.BankaTasks;
import cz.moneta.test.dsl.util.credentials.Keys;
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 org.junit.jupiter.api.Disabled;

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

@Disabled
@TestScenario(name = "Teller must be able to create new smooth (foreign) payment")
public class CreateNewSmoothPayment {

    @TestCase(name = "Teller must be able to create new smooth (foreign) payment", environments = {TST1, PPE})
    @JiraTestCase(id = "POB-T18078")
    public void createNewSmoothPayment(Harness harness, @Key(Keys.ufo.banka.banker) Credentials credentials,
                                       @Key(Keys.ufo.banka.secondBanker) Credentials credentialsSecondBanker) {
        BankaTasks bankaTasks = harness.tasks().ufo().banka();

        String finalAmount = "100";
        String accountNumberReceiver = "SK4409000000003001979752";
        String receiverName = "Auto Test";
        String receiverAddressStreet = "Kratka";
        String receiverAddressCity = "Bratislava";
        String receiverAddressCountryCode = "SK";
        String currency = "EUR";
        String rcClient = harness.getConfig("branch.squad.rc.client");

        harness.withUfo()
                .openLoginPage()
                .then(bankaTasks.login().withCredentials(credentials))
                .then(bankaTasks.search().findByRC(rcClient))
                .checkProductActive("Běžný účet")
                .getCurrentAccountNumberAndStore()
                .openCurrentAccountDetailPage()
                .openListOfForeignPaymentsPage()
                .then(bankaTasks.payment().createNewSmoothPayment(currency, accountNumberReceiver, receiverName, receiverAddressStreet, receiverAddressCity, receiverAddressCountryCode));
    }
}
