package cz.moneta.test.dsl.hypos;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.hypos.pages.HyposLoginPage;
import cz.moneta.test.harness.endpoints.hypos.HyposEndpoint;
import cz.moneta.test.harness.support.web.Builders;

public class Hypos {
    private final Harness harness;

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

    public HyposLoginPage openLoginPage() {
        HyposEndpoint hyposEndpoint = harness.getEndpoint(HyposEndpoint.class);
        hyposEndpoint.openApplication();
        return Builders.newWebFlowBuilder(HyposLoginPage.class, hyposEndpoint, harness);
    }

    public void closeHypos() {
        harness.closeEndpoint(harness.getEndpoint(HyposEndpoint.class));
    }
}