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 buildings savings loan page")
public class BuilgingSavingsLoanTest {

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

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