package cz.moneta.test.regression.commercial.salesforce.web;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.salesforce.tasks.SalesForceTasks;
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;

@TestScenario(name = "Login to SalesForce and search account")
public class SearchTest {

    @TestCase(name = "Login to SalesForce and search account", environments = {Environment.TST1})
    @JiraTestCase(id = "SC-T752")
    public void loginAndSearchAccount(Harness harness) {
        String accountToSearch = harness.getConfig("salesforce.test.account");
        SalesForceTasks tasks = harness.tasks().salesForce();

        harness.withSalesForce()
                .openLoginPage()
                .then(tasks.loginAsBanker())
                .then(tasks.openAccountDetail(accountToSearch))
                .logoutUser();
    }

}
