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 Homepage")
public class HomePageTest {

    @TestCase(name = "Check W2C from Homepage", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T364")
    public void tcHomePageW2C(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .clickHomePageW2C()
                .then(tasks.commonTasks().fillW2C("777777777"));
    }

    @TestCase(name = "Check W2B from Homepage", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T365")
    public void tcHomePageW2B(Harness harness) {
        MonetaPortalTasks tasks = harness.tasks().monetaPortal();
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .clickHomePageW2B()
                .clickW2BSearchBranch()
                .fillW2BSearchBranch(BRUMLOVKA.getValue())
                .clickW2BSearchResultBranches(BRUMLOVKA)
                .clickW2BArrangeAppointment()
                .then(tasks.commonTasks().fillW2B(3,8,"Petr Testovič","777777777", "petr.pollak@moneta.cz"));
    }

    @TestCase(name = "Check online support page from Homepage", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T368")
    public void tcHomePageOnlineSupport(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .clickOnlineSupport()
                .checkOnlineSupportBanner();
    }

    @TestCase(name = "Check Exchange rates from HomePage", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T369")
    public void tcHomePageExchangeRates(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .checkHomePageExchangeRatesTable()
                .clickExchangeRatesTableMore()
                .checkExchangeRatesTable();
    }

    @TestCase(name = "Check ATMs from Homepage", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T420")
    public void tcHomePageATMs(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .clickHomePageATMs()
                .checkATMsMap();
    }

    @TestCase(name = "Check branches from Homepage", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T421")
    public void tcHomePageBranches(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .clickHomePageBranches()
                .checkBranchesMap();
    }

    @TestCase(name = "Check online product page from Homepage", environments = {Environment.TST1, Environment.PPE})
    @JiraTestCase(id = "NWP-T422")
    public void tcHomePageOnlineProduct(Harness harness) {
        harness.withMonetaPortal()
                .openHomePage()
                .acceptCookies()
                .clickOnlineProducts()
                .checkOnlineProductBorder();
    }
}