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 Current account page")
public class CurrentAccountTest {
    @TestCase(name = "Check Current account form", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T458")
    public void tcCurrentAccountForm(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCurrentAccountPage()
                .clickCurrentAccountNaviblocksSection()
                .clickNaviblocksCurrentAccountCreateNewClientsOnline()
                .then(tasks.formTasks().fillOnboardingForm("Petr","Testovič","petr.pollak@moneta.cz","777777777"));
    }

    @TestCase(name = "Check W2B for Current account page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T459")
    public void tcCurrentAccountW2B(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openAccountsMenu()
                .openCurrentAccountPage()
                .clickCurrentAccountNaviblocksSection()
                .clickNaviblocksW2B()
                .clickW2BSearchBranch()
                .fillW2BSearchBranch(BRUMLOVKA.getValue())
                .clickW2BSearchResultBranches(BRUMLOVKA)
                .clickW2BArrangeAppointment()
                .then(tasks.commonTasks().fillW2B(1,5,"Petr Testovič", "777777777", "petr.pollak@moneta.cz"));
    }

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