package cz.moneta.test.regression.channels.digital.ib.oldib.loan;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.Environment;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import cz.moneta.test.harness.support.auth.Credentials;
import org.junit.jupiter.api.Disabled;

@TestScenario(name = "Functionality test of mortgage calculator in Internet bank")
public class MortgageCalculatorTest {

    @Disabled
    @TestCase(name = "Test of fields and recalculation mortgage value after change parameters", environments = {Environment.TST1, Environment.PPE})
    public void recalculationMortgagesValues(Harness harness) {
        String mortgageAmount = "700000";
        String freeResources = "125000";
        String birthNumber = harness.getConfig("IB.rc.mortgages.calculator");

        Credentials credentialsIb = harness.withUdebs()
                .ib()
                .usernameAndPassword()
                .getUsernameAndPasswordByRc(birthNumber);

        harness.withIB()
                .openLoginPage()
                .then(harness.tasks().ib().loginWithDefaultMobileKeyAnd(credentialsIb))
                .clickMortgages()
                .clickToMortgageCalculatorInMenu()
                .checkCalculatorInputsPanelElements()
                .checkCalculatorRsultPanelElements()
                .getMonthlyPaymentAndCheckNotUndefinedValue()
                .changeMortgageAmountAndCheckChangeValueMonthlyPayment(mortgageAmount)
                .changeFreeResourcesAndCheckChangeValueMonthlyPayment(freeResources)
                .changeFixationLenghtAndCheckChangeValueMonthlyPayment()
                .insuranceAbilityPaymentAndCheckChangeValueMonthlyPayment()
                .clickIAmInterestedButton();
    }
}
