package cz.moneta.test.dsl.salesforce;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.salesforce.pages.LoginPage;
import cz.moneta.test.harness.endpoints.sales_force.SalesForceEndpoint;
import cz.moneta.test.harness.support.web.Builders;

public class SalesForce {
    private final Harness harness;

    public SalesForce(Harness harness) {
        this.harness = harness;
    }

    public LoginPage openLoginPage() {
        SalesForceEndpoint salesForceEndpoint = harness.getEndpoint(SalesForceEndpoint.class);
        salesForceEndpoint.openApplication();
        return Builders.newWebFlowBuilder(LoginPage.class, salesForceEndpoint, harness);
    }

    public void closeSalesForce() {
        harness.closeEndpoint(harness.getEndpoint(SalesForceEndpoint.class));
    }
}
