package cz.moneta.test.dataprepare.risk;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.ufo.banka.pages.search.HLO001_S001_ClientSearchPage;
import cz.moneta.test.dsl.util.data.ClientUtils;
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.banka.banker;

@TestScenario(name = "Test for Risk Retail - Data preparation - new clients")
public class NewClients extends DefaultClientPrepare {

    @TestCase(name = "New clients")
    public void newClients(Harness harness, @Key(banker) Credentials credentials) {
        HLO001_S001_ClientSearchPage window = harness.withUfo()
                .openLoginPage()
                .then(bankaTasks.login().withCredentialsAndTurnOffSignpad(credentials));

        for (int i = 0; i < clientCount; i++) {
            applicant = ClientUtils.getRiskDefaultClient(harness);
            window = window
                    .then(bankaTasks.newClient().create(applicant, credentials.getUsername()))
                    .clickSearch();
            clientBirthNumbers.add(applicant.birthNumber());
        }
    }
}