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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.ufo.banka.tasks.BankaTasks;
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 static cz.moneta.test.dsl.util.credentials.Keys.ufo;
import static cz.moneta.test.harness.annotations.Environment.EDU;
import static cz.moneta.test.harness.annotations.Environment.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;

@TestScenario(name = "Banker is able to crate a new customer")
public class CreateNewCustomer {

    @TestCase(name = "Banker is able to login and create a new customer", environments = {TST1, PPE, EDU})
    @JiraTestCase(id = "POB-T19489")
    public void bankerIsAbleCreateNewCustomer(Harness harness, @Key(ufo.banka.banker) Credentials banker) {
        BankaTasks bankaTasks = harness.tasks().ufo().banka();

        harness.withUfo()
                .openLoginPage()
                .then(bankaTasks.login().withCredentialsAndTurnOffSignpad(banker))
                .then(bankaTasks.newClient().create(banker.getUsername()))
                .verifyThatCifIsValid();
    }
}
