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;

@Disabled("Not currently maintained")
@TestScenario(name = "Check holding funds page")
public class HoldingFundsTest {

    @TestCase(name = "Check holding funds form", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T454")
    public void tcHoldingFundsForm(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openSavingsMenu()
                .openHoldingFundsPage()
                .clickHoldingFundsPageNaviblocksSection()
                .clickNaviblocksInvestOnline()
                .then(tasks.formTasks().fillOnboardingForm("Petr","Testovič","petr.pollak@moneta.cz","777777777"));
    }

    @TestCase(name = "Check W2C for holding funds page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T455")
    public void tcHoldingFundsW2C(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openSavingsMenu()
                .openHoldingFundsPage()
                .clickHoldingFundsPageNaviblocksSection()
                .clickNaviblocksW2C()
                .then(tasks.commonTasks().fillW2C("777777777"));
    }

    @TestCase(name = "Check opening branch page from holding funds page", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T456")
    public void tcHoldingFundsBranchPage(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .openSavingsMenu()
                .openHoldingFundsPage()
                .clickFooterCallFreeBranchPage()
                .checkBranchesMap();
    }
}