package cz.moneta.test.dsl.util.task.auto.smartauto.setman.login;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.setman.LoginPage;
import cz.moneta.test.dsl.auto.smartauto.setman.MainPage;
import cz.moneta.test.harness.support.auth.Credentials;

import java.util.function.Function;

public class LoginTasks {

    private final Harness harness;

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

    public Function<LoginPage, MainPage> loginWithCredentials(Credentials credentials) {
        return start -> start.typeUsername(credentials.getUsername())
                .typePassword(credentials.getPassword())
                .clickLogin();
    }
}
