package cz.moneta.test.regression.channels.digital.web;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.util.task.monetaportal.MonetaPortalTasks;
import cz.moneta.test.harness.annotations.Environment;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import org.junit.jupiter.api.Disabled;

import static cz.moneta.test.dsl.monetaportal.enums.SearchBranchName.BRUMLOVKA;

@Disabled("Not currently maintained")
@TestScenario(name = "Check bridging loan page")
public class BridgingLoanTest {

    @TestCase(name = "Check bridging loan calculator", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T405")
    public void tcBridgingLoanCalculator(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openLoansMenu()
                .openBridgingLoanPage()
                .clickBridgingCalculatorSection()
                .then(tasks.calculatorTasks().fillLoanCalculator("1200000", 70, "24", 16));
    }

    @TestCase(name = "Check W2B for bridging loan page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T406")
    public void tcBridgingLoanW2B(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openLoansMenu()
                .openBridgingLoanPage()
                .clickNaviblocksW2B()
                .clickW2BSearchBranch()
                .fillW2BSearchBranch(BRUMLOVKA.getValue())
                .clickW2BSearchResultBranches(BRUMLOVKA)
                .clickW2BArrangeAppointment()
                .then(tasks.commonTasks().fillW2B(3,6,"Petr Testovič", "777777777", "petr.pollak@moneta.cz"));
    }

    @TestCase(name = "Check W2C for bridging loan page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T407")
    public void tcBridgingLoanW2C(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openLoansMenu()
                .openBridgingLoanPage()
                .clickNaviblocksW2C()
                .then(tasks.commonTasks().fillW2C("777777777"));
    }
}