package cz.moneta.test.regression.commercial.auto.smartauto;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.shared.DateData;
import cz.moneta.test.dsl.util.credentials.Keys.smart;
import cz.moneta.test.dsl.util.task.auto.smartauto.SmartAutoTasks;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import cz.moneta.test.harness.support.auth.Credentials;
import cz.moneta.test.harness.support.auth.Key;
import cz.moneta.test.regression.commercial.auto.smartauto.mockdata.SharedMock;
import org.junit.jupiter.api.Disabled;

@Disabled
@TestScenario(name = "Invoices at SMARTauto.")
public class InvoicesTest {

    @JiraTestCase(id = "LAMD-1801")
    @TestCase(name = "Invoices test filter by date.")
    public void tcInvoicesTestFilterByDate(Harness harness, @Key(smart.auto.general) Credentials credentials) {
        SmartAutoTasks smartAutoTasks = harness.tasks().auto().smartAuto();
        DateData dateDataFrom = SharedMock.prepareDateDataFrom();
        DateData dateDataTo = SharedMock.prepareDateDataTo();

        harness.withSmartAuto()
                .openLoginPage()
                .then(smartAutoTasks.login().loginWithCredentials(credentials))
                .then(smartAutoTasks.goTo().invoicesPage())
                .then(smartAutoTasks.invoicesTasks().setFromDate(dateDataFrom))
                .then(smartAutoTasks.invoicesTasks().setToDate(dateDataTo))
                .then(smartAutoTasks.invoicesTasks().search());
    }


}