package cz.moneta.test.dsl.exevido.tasks;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.exevido.pages.IncomingMessagesPage;
import cz.moneta.test.dsl.exevido.pages.NewIncomingMessagePage;

import java.util.function.Function;

public class CreateNewIncomingMessageTasks {

    private final Harness harness;

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

    public Function<IncomingMessagesPage, NewIncomingMessagePage> forInheritance(String subject, String sender, String attachment) {
        return start -> start
                .clickCreateNewIncomingMessage()
                .fillSubject(subject)
                .fillSender(sender)
                .fillTypeMessage("D - Žádost [M] - MMB")
                .uploadAttachment(attachment)
                .clickSave()
                .acceptAlertIfVisible()
                .storeMessageId();
    }
}
