package cz.moneta.test.regression.internal.forte;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.forte.components.ForteRoles;
import cz.moneta.test.harness.annotations.Environment;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenarioWithOrder;
import org.junit.jupiter.api.Order;

@TestScenarioWithOrder(name = "Contracts tests")
public class ContractsTest {

    @Order(1)
    @TestCase(name = "Find contract by params", environments = {Environment.TST1})
    public void findContractByParam(Harness harness) {
        harness.withForte()
                .openForteHomePage()
                .clickContracts()
                .selectRoleMenu(ForteRoles.OPERATOR_FINANCE)
                .clickFindContracts()
                .clickClearForm()
                .clickFindContracts()
                .selectSearchBy("Parametry")
                .fillContractName("Lidl")
                .clickSearchContract()
                .clickFirstResultDetail();
    }

    @Order(2)
    @TestCase(name = "Open payments detail", environments = {Environment.TST1})
    public void checkPaymentsList(Harness harness) {
        harness.withForte()
                .openForteHomePage()
                .clickContracts()
                .selectRoleMenu(ForteRoles.OPERATOR_FINANCE)
                .clickPaymentsList()
                .clickCurrentMonth()
                .clickFirstPaymentDetail();
    }

    @Order(3)
    @TestCase(name = "Contracts - check menu", environments = {Environment.TST1})
    public void checkContractsMenu(Harness harness) {
        harness.withForte()
                .openForteHomePage()
                .clickContracts()
                .selectRoleMenu(ForteRoles.OPERATOR_FINANCE)
                .clickEnumsCdrAccounts()
                .clickEnumsCurrency()
                .clickEnumsCostCenters()
                .clickEnumsDphRates()
                .clickEnumsPaymentCategories()
                .clickEnumsPaymentTerms()
                .clickEnumsValorization()
                .clickEnumsAccountingBridge()
                .clickEnumsChangeTypes()
                .clickEnumsDiscountRates()
                .clickEnumsBLE();
    }
}
