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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.shared.*;
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 = "Queue at SMARTauto.")
public class QueueTest {

    @JiraTestCase(id = "LAMD-T1802")
    @TestCase(name = "Filter Queue by date.")
    public void tcTestQueueFilterByDate(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().queuePage())
                .then(smartAutoTasks.queue().setFromDate(dateDataFrom))
                .then(smartAutoTasks.queue().setToDate(dateDataTo))
                .then(smartAutoTasks.queue().search())
                .then(smartAutoTasks.queue().checkQueueItem());
    }
}