package cz.moneta.test.sanity.transactional.cards.ufo.operations;

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

import static cz.moneta.test.dsl.util.credentials.Keys.ufo;
import static cz.moneta.test.harness.annotations.Environment.FVE;
import static cz.moneta.test.harness.annotations.Environment.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;
import static cz.moneta.test.harness.annotations.Environment.TST3;

@TestScenario(name = "Bank teller must be able to login to UFO Ops")
public class BasicLogin {

    @TestCase(name = "Bank teller is able to login into UFO OPS", environments = {TST1, TST3, FVE, PPE})
    @JiraTestCase(id = "FVP-T1896")
    public void tc_bank_teller_is_able_to_find_client_by_RC(Harness harness, @Key(ufo.banka.banker) Credentials credentials) {
        String RCofExistingClient = SmokeData.getInstance(harness).getCreditData().getRc();

        harness.withUfo()
                .openLoginPage()
                .then(harness.tasks().ufo().operations().login().withCredentials(credentials))
                .fillSearchInput(RCofExistingClient)
                .clickSearchClient()
                .onClientDetailsPage();
    }
}