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 credit card page")
public class CreditCardTest {

    @TestCase(name = "Check credit card calculator", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T432")
    public void tcCreditCardCalculator(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCreditCardPage()
                .fillCreditCalculatorAmountInput("44000")
                .moveCreditCalculatorAmount(5);
    }

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

    @TestCase(name = "Check Smart bank from credit card page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T434")
    public void tcCreditCardSmartBank(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCreditCardPage()
                .openNaviblocksSB()
                .checkSBPage();
    }

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

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