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
@TestScenario(name = "Check credit account page")
public class CreditAccountTest {
    @TestCase(name = "Check W2B for credit account page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T437")
    public void tcCreditAccountW2B(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCreditAccountPage()
                .clickNaviblocksW2B()
                .clickW2BSearchBranch()
                .fillW2BSearchBranch(BRUMLOVKA.getValue())
                .clickW2BSearchResultBranches(BRUMLOVKA)
                .clickW2BArrangeAppointment()
                .then(tasks.commonTasks().fillW2B(3,3,"Petr Testovič","777777777", "petr.pollak@moneta.cz"));
    }

    @TestCase(name = "Check W2C for credit account page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T438")
    public void tcCreditAccountW2C(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCreditAccountPage()
                .clickNaviblocksW2C()
                .then(tasks.commonTasks().fillW2C("777777777"));
    }

    @Disabled
    @TestCase(name = "Check credit account calculator", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T439")
    public void tcCreditAccountCalculator(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCreditAccountPage()
                .clickCreditOnlineSection()
                .clickNaviblocksCreditAccountButton()
                .fillCreditCalculatorAmountInput("44000")
                .moveCreditCalculatorAmount(5);
    }

    @Disabled
    @TestCase(name = "Check credit account form", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T440")
    public void tcCreditAccountForm(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCreditAccountPage()
                .clickCreditOnlineSection()
                .clickNaviblocksCreditAccountButton()
                .clickCreditCalculatorOnlineButton()
                .then(tasks.formTasks().fillOnboardingForm("Petr","Testovič","petr.pollak@moneta.cz","777777777"));
    }

    @Disabled
    @TestCase(name = "Check W2B for get credit account page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T441")
    public void tcGetCreditAccountW2B(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCreditAccountPage()
                .clickCreditOnlineSection()
                .clickNaviblocksCreditAccountButton()
                .clickNaviblocksW2B()
                .clickW2BSearchBranch()
                .fillW2BSearchBranch(BRUMLOVKA.getValue())
                .clickW2BSearchResultBranches(BRUMLOVKA)
                .clickW2BArrangeAppointment()
                .then(tasks.commonTasks().fillW2B(1,3,"Petr Testovič","777777777", "petr.pollak@moneta.cz"));
    }

    @Disabled
    @TestCase(name = "Check W2C for get credit account page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T442")
    public void tcGetCreditAccountW2C(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCreditAccountPage()
                .clickCreditOnlineSection()
                .clickNaviblocksCreditAccountButton()
                .clickNaviblocksW2C()
                .then(tasks.commonTasks().fillW2C("777777777"));
    }
}
