package cz.moneta.test.regression.channels.digital.ml.brokersportal;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.util.task.brokerportal.BrokerPortalTasks;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.NonConcurrentTestScenario;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.support.auth.Credentials;
import cz.moneta.test.harness.support.auth.Key;

import static cz.moneta.test.dsl.util.credentials.Keys.brokerPortal;

@NonConcurrentTestScenario(name = "Check contract list")
public class ContractListTest {

    @TestCase(name = "Check contract list")
    @JiraTestCase(id = "ML-T2588")
    public void tcCheckContractList(Harness harness, @Key(brokerPortal.broker) Credentials broker) {
        BrokerPortalTasks tasks = harness.tasks().brokerPortal();
        String contractState = "Obchod založen - kontrola OK";

        harness.withBrokerPortal()
                .openLoginPage()
                .then(tasks.loginTasks().loginWithCredentials(broker))
                .clickContracts()
                .selectState(contractState)
                .searchContracts()
                .checkContractState(contractState);
    }
}