package cz.moneta.test.regression.channels.branch.archive;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.ufo.banka.tasks.BankaTasks;
import cz.moneta.test.dsl.util.data.client.IdCard;
import cz.moneta.test.dsl.util.data.client.NonClient;
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 org.junit.jupiter.api.Disabled;

import java.time.LocalDate;

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;

@Disabled
@TestScenario(name = "Teller must be able to crate a new customer with BU, PK and IB over OneClick")
public class OneClick {

    /**
     * Tests only part of manual test.
     * Ends at step 21 (4.2.2025) on the page BAL035_S002_SummaryOfProductFoundationRetailPage.
     **/
    @TestCase(name = "Bank teller is able to login and create a new customer with BU, PK and IB over OneClick", environments = {TST1, PPE})
    @JiraTestCase(id = "POB-T19525")
    public void oneClickTest(Harness harness, @Key(ufo.banka.banker) Credentials credentials) {
        BankaTasks bankaTasks = harness.tasks().ufo().banka();
        NonClient nonClient = harness.data().newNonClient().withMobileNumber("725559544")
                .withIdCard(new IdCard("208243633", LocalDate.now(), LocalDate.now().plusYears(3)));
        harness.withUfo()
                .openLoginPage()
                .then(bankaTasks.login().withCredentialsAndTurnOffSignpad(credentials))
                .then(bankaTasks.newClient().create(nonClient, credentials.getUsername()))
                .then(bankaTasks.oneClick().createOneClickFon())
                .checkProductActive("Tom Plus")
                .checkProductActive("PK")
                .checkProductActive("Internet Banka heslo/MK; Aktivní");
    }
}
