package cz.moneta.test.regression.channels.digital.ib.oldib.account.sipopayment;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.util.data.generators.SipoGenerator;
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;

@TestScenario(name = "Verify new sipo order")
public class SipoOrderTest {

    @Disabled
    @TestCase(name = "Create new sipo order", environments = {TST1, PPE})
    @JiraTestCase(id = "IB-T8265")
    void userWithCurrentAccount_shouldCreateNewSipoOrder(Harness harness, @Key("ib.client") Credentials credentials) {
        SipoGenerator sipoGenerator = new SipoGenerator();
        String sipo = sipoGenerator.generate(harness);

        harness.withIB()
                .openLoginPage()
                .then(harness.tasks().ib().loginWithDefaultMobileKeyAnd(credentials))
                .clickAccountsAndTransactions()
                .clickStandingOrders()
                .clicNewSipoOrder()
                .clickFromAccountSelect()
                .fillSipoNumber(sipo)
                .fillSipoLimit("100")
                .fillEndDate("12.2040")
                .clickContinueButton()
                .typeSmsCode("12341234")
                .clickSign()
                .clickSipoList();
    }
}