package cz.moneta.test.smoke.itp.ieufotomcat;

import cz.moneta.test.dsl.Harness;
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.*;

@TestScenario(name = "UFO Bank on Tomcat teller must be able to find client by RC on UFO Tomcat")
public class LookupClientByRcUfoTomcatBanka {

    @TestCase(name = "UFO Bank on Tomcat teller is able to login and lookup client by RC on UFO Tomcat", environments = {TST1, TST3, PPE, EDU, FVE})
    public void tcUfoBankTomcatTellerIsAbleToFindClientByRc(Harness harness, @Key(ufo.banka.banker) Credentials credentials) {

        String rcOfExistingClient = harness.getConfig("channels.branch.rc-of-existing-client");

        harness.withUfo()
                .openLoginPage()
                .then(harness.tasks().ufo().banka().login().withCredentials(credentials))
                .fillSearchTerm(rcOfExistingClient)
                .clickSearchByRc()
                .onClientDetailPage()
                .verifyThatClientHasSomeActiveProducts();
    }
}
