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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.util.task.ufo.cb.CommercialTasks;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;

import static cz.moneta.test.harness.annotations.Environment.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;

@TestScenario(name = "UFO CB teller must be able to find client by RC")
public class LookupClientByRcUfoCb {

    @TestCase(name = "UFO CB teller is able to login and lookup client by RC", environments = {TST1, PPE})
    @JiraTestCase(id = "TEA-T30")
    void lookupClientByRcUfoCbSmokeTest(Harness harness) {
        String rcOfExistingClient = harness.getConfig("channels.branch.rc-of-existing-client");
        CommercialTasks commercialTasks = harness.tasks().ufo().cb();

        harness.withUfo()
                .openLoginPage()
                .then(commercialTasks.loginAsCbBanker())
                .clickSearchLink()
                .pickRc()
                .typeDetailForSearch(rcOfExistingClient)
                .clickSearch()
                .checkRc(rcOfExistingClient);
    }
}
