package cz.moneta.test.regression.transactional.payments.cash.kasanova.section8;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.kasanova.components.enums.KSNCoinSplits;
import cz.moneta.test.dsl.kasanova.components.enums.KSNGender;
import cz.moneta.test.dsl.kasanova.components.enums.KSNOriginDeposit;
import cz.moneta.test.dsl.util.credentials.Keys.kasanova;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.NonConcurrentTestScenario;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.support.auth.Credentials;
import cz.moneta.test.harness.support.auth.Key;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.TestMethodOrder;

@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@NonConcurrentTestScenario(name = "(Fce 86) Výměna hotovosti")
public class KSNFunction86Test {

    @Order(1)
    @JiraTestCase(id="PAY-T1720")
    @TestCase(name = "(Fce 86)")
    public void func86incompleteBanknotes(Harness harness, @Key(kasanova.banker) Credentials banker) {
        harness.log("---------------- (FUNCTION 86) ----------------");
        harness.withKasanova()
            .openLoginPage()
            .then(harness.tasks().kasanova().loginWithUserAndPassword(banker))
            .KSNSection8()
            .KSNFunction86()
            .coinSplitTable(KSNCoinSplits.COINSPLIT_DELIVERED_CZK_10_INPUT, "500")
            .coinSplitTable(KSNCoinSplits.COINSPLIT_REQUESTED_CZK_10_INPUT, "500")
            .fillIdentificationMini()
            .sex(KSNGender.getRandomGenderValue())
            .selectFee("Necelé bankovky")
            .continueWithPrintAction()
            .dismissPrintWindow()
            .continueWithSaveAction()
            .checkFunctionIsDone()
            .logOut();

        harness.log("---------------- (FUNCTION 86) ----------------");
    }

    @Order(2)
    @JiraTestCase(id="PAY-T1721")
    @TestCase(name = "(Fce 86)")
    public void func86unsortedCash(Harness harness, @Key(kasanova.banker) Credentials banker) {
        harness.log("---------------- (FUNCTION 86) ----------------");
        harness.withKasanova()
            .openLoginPage()
            .then(harness.tasks().kasanova().loginWithUserAndPassword(banker))
            .KSNSection8()
            .KSNFunction86()
            .coinSplitTable(KSNCoinSplits.COINSPLIT_DELIVERED_CZK_5000_INPUT, "10")
            .coinSplitTable(KSNCoinSplits.COINSPLIT_REQUESTED_CZK_5000_INPUT, "10")
            .fillIdentificationShort()
            .sex(KSNGender.getRandomGenderValue())
            .selectFee("10.00% Neroztříděná hotovost")
            .continueWithPrintAction()
            .kasanovaDialogClickYes()
            .dismissPrintWindow()
            .continueWithSaveAction()
            .checkFunctionIsDone()
            .logOut();

        harness.log("---------------- (FUNCTION 86) ----------------");
    }

    @Order(3)
    @JiraTestCase(id="PAY-T1722")
    @TestCase(name = "(Fce 86)")
    public void func86cashExchange(Harness harness, @Key(kasanova.banker) Credentials banker) {
        harness.log("---------------- (FUNCTION 86) ----------------");
        harness.withKasanova()
            .openLoginPage()
            .then(harness.tasks().kasanova().loginWithUserAndPassword(banker))
            .KSNSection8()
            .KSNFunction86()
            .coinSplitTable(KSNCoinSplits.COINSPLIT_DELIVERED_CZK_5000_INPUT, "100")
            .sex(KSNGender.getRandomGenderValue())
            .dismissMultiAlerts(3)
            .originePurpose(KSNOriginDeposit.PUVOD_VKLADU_1.getValue())
            .coinSplitTable(KSNCoinSplits.COINSPLIT_REQUESTED_CZK_5000_INPUT, "100")
            .fillIdentificationLong()
            .selectFee("Výměna hotovosti")
            .continueWithPrintAction()
            .kasanovaDialogClickYes()
            .dismissPrintWindow()
            .continueWithSaveAction()
            .checkFunctionIsDone()
            .logOut();

        harness.log("---------------- (FUNCTION 86) ----------------");
    }
}
