package cz.moneta.test.regression.channels.digital.ib.newib.dashboard;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.newib.tasks.NewIbTasks;
import cz.moneta.test.harness.annotations.Environment;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenarioWithOrder;
import cz.moneta.test.harness.support.auth.Credentials;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Order;


@TestScenarioWithOrder(name = "Payments options on Dashboard test")
public class DashboardTest {
    Credentials clientCredentials;

    @BeforeAll
    public void getCredentials(Harness harness) {
        String clientBirthNumber = harness.getConfig("nib.rc.payments-one-account");

        clientCredentials = harness.tasks()
                .udebs()
                .findCredentialsByRC(clientBirthNumber);
    }

    @Order(1)
    @Disabled("Due to rewriting all IB regression tests")
    @TestCase(name = "Payments options on Dashboard", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NIB-T1581")
    public void paymentsOptionsOnDashboard(Harness harness) {
        NewIbTasks newIbTasks = harness.tasks().newIb();

        harness.withNewIb()
                .openLoginPage()
                .then(newIbTasks.loginWithUsernamePasswordAndDefaultMobKey(clientCredentials.getUsername(), clientCredentials.getPassword()))
                .then(newIbTasks.checkPaymentOptionsOnDashboard());
    }
}
