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 = "Downloads client pricing review file and check its name")
public class DownloadTests {

    //TODO SalesForce on PPE is not up to date, needs to be added and retested after its update
    @TestCase(name = "Downloads client pricing review file and check its name", environments = {Environment.TST1})
    @JiraTestCase(id = "SC-T771")
    public void downloadClientPricingReview(Harness harness) {
        SalesForceTasks tasks = harness.tasks().salesForce();
        String account = harness.getConfig("salesforce.test.account");

        harness.withSalesForce()
                .openLoginPage()
                .then(tasks.loginAsBanker())
                .then(tasks.openAccountDetail(account))
                .onAccountDetailPage()
                .clickPricingReviewAndWaitForDownload()
                .logoutUser();
    }

}
