package cz.moneta.test.dsl.mobile.smartbanking.home;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.mobile.smartbanking.activation.ActivationView;
import cz.moneta.test.dsl.mobile.smartbanking.landing.LandingView;
import cz.moneta.test.harness.endpoints.smartbanka.MobilePlatform;
import cz.moneta.test.harness.endpoints.smartbanka.SbEndpoint;
import cz.moneta.test.harness.support.mobile.share.Builders;

public class Sb {

    private final Harness harness;

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

    public LandingView onLandingPage() {
        SbEndpoint endpoint = harness.getEndpoint(SbEndpoint.class);
        endpoint.connect();
        return Builders.newMobileFlowBuilder(LandingView.class, endpoint, harness);
    }

    public ActivationView onActivationPage() {
        SbEndpoint endpoint = harness.getEndpoint(SbEndpoint.class);
        endpoint.resetApp();
        if (!MobilePlatform.isAndroid(harness)) {
            endpoint.acceptAlert(5);
        }
        return Builders.newMobileFlowBuilder(ActivationView.class, endpoint, harness);
    }
}
