package cz.moneta.test.dsl.payment_engine;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.payment_engine.login.PaymentEngineLoginPage;
import cz.moneta.test.harness.endpoints.payment_engine.PaymentEngineEndpoint;
import cz.moneta.test.harness.support.web.Builders;

public class PaymentEngine {
    private Harness harness;

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

    public PaymentEngineLoginPage openLoginPage(){
        PaymentEngineEndpoint endpoint = harness.getEndpoint(PaymentEngineEndpoint.class);
        endpoint.openApplication();
        return Builders.newWebFlowBuilder(PaymentEngineLoginPage.class, endpoint, harness);
    }

    public void closePaymentEngine() {
        harness.closeEndpoint(harness.getEndpoint(PaymentEngineEndpoint.class));
    }
}