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 business loan page")
public class BusinessLoanTest {

    @TestCase(name = "Check business loan calculator", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T396")
    public void tcBusinessLoanCalculator(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openLoansMenu()
                .openExpressBusinessLoanPage()
                .clickBusinessCalculatorSection()
                .then(tasks.calculatorTasks().fillBusinessCalculator("440000", 94, "94", 88));
    }

    @TestCase(name = "Check business loan wizard", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T397")
    public void tcBusinessLoanWizard(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openLoansMenu()
                .openExpressBusinessLoanPage()
                .clickNaviblocksCreateBusinessExpressOnline()
                .clickBusinessWizardContinue()
                .checkBusinessWizardICO();
    }

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

    @TestCase(name = "Check IB from business loan page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T399")
    public void tcOpenIBPage(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openLoansMenu()
                .openExpressBusinessLoanPage()
                .openNaviblocksOpenIB()
                .checkIBPage();
    }
}