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 = "Saved Calculations at SMARTauto.")
public class SavedCalculationsTest {

    @JiraTestCase(id = "LAMD-T1803")
    @TestCase(name = "Filter Saved Calculations by datum.")
    public void tcFilterSavedCalculationsByDatum(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().savedCalculationsPage())
                .then(smartAutoTasks.savedCalculations().setFromDate(dateDataFrom))
                .then(smartAutoTasks.savedCalculations().setToDate(dateDataTo))
                .then(smartAutoTasks.savedCalculations().search())
                .then(smartAutoTasks.savedCalculations().checkSavedItem());
    }
}