package cz.moneta.test.regression.feeincome.insurance;

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.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;

@TestScenario(name = "New Insurance Check")
public class NewInsuranceCheck {

    @TestCase(name = "New Insurance check", environments = {TST1, PPE})
    @JiraTestCase(id = "INS-T393")
    void arrangementNewInsuranceCheck(Harness harness, @Key(ufo.banka.banker) Credentials ufoBanker) {
        String productName = "Pojištění osobních věcí, platebních karet a internetových rizik";
        String birthNumber = harness.getConfig("rc.arrangementNewInsuranceCheck");
        BankaTasks tasks = harness.tasks().ufo().banka();

        harness.withUfo()
                .openLoginPage()
                .then(tasks.login().withCredentials(ufoBanker))
                .fillSearchTerm(birthNumber)
                .clickSearchByRc()
                .onClientDetailPage()
                .checkProductActive(productName);
    }
}