All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cz.pumpitup.pn5.robot.Marvin Maven / Gradle / Ivy

Go to download

Marvin is here to help you with your RPA needs. He brings the power of Pumpo #5 with him.

There is a newer version: 0.5.16
Show newest version
package cz.pumpitup.pn5.robot;

import cz.pumpitup.pn5.core.LogLevel;
import cz.pumpitup.pn5.core.spring.Core;
import cz.pumpitup.pn5.core.util.ExtensionUtils;
import cz.pumpitup.pn5.core.webdriver.Capability;
import cz.pumpitup.pn5.web.WebApplication;
import cz.pumpitup.pn5.web.WebApplicationSupport;
import cz.pumpitup.pn5.win.WindowsApplication;
import cz.pumpitup.pn5.win.WindowsApplicationSupport;

import java.util.Arrays;
import java.util.Map;

public class Marvin {

    /**
     * Deprecated: please use bootstrapWindowsApplication
     */
    @Deprecated(forRemoval = true)
    public static WindowsApplication bootstrapApplication(Map capabilities) {
        return bootstrapWindowsApplication(capabilities);
    }

    /**
     * Deprecated: please use bootstrapWindowsApplication
     */
    @Deprecated(forRemoval = true)
    public static  APPLICATION_OBJECT bootstrapApplication(Class type) {
        return bootstrapWindowsApplication(type);
    }

    public static WindowsApplication bootstrapWindowsApplication(Map capabilities) {
        return WindowsApplicationSupport.createProxy(WindowsApplication.class, null, capabilities, new Core());
    }

    public static  APPLICATION_OBJECT bootstrapWindowsApplication(Class type) {
        Core core = new Core();
        String driverUrl = ExtensionUtils.getDriverUrl(type, core.getConfig());
        core.getLogger().log(LogLevel.INFO, "Creating proxy for driver of type " + type.getSimpleName() + " on url: " + driverUrl);
        Map capabilities = Arrays.stream(type.getAnnotationsByType(Capability.class))
                .collect(ExtensionUtils.toCapabilitiesMap(core.getConfig()));
        return WindowsApplicationSupport.createProxy(type, driverUrl, capabilities, core);
    }

    public static WebApplication bootstrapWebApplication(Map capabilities) {
        return WebApplicationSupport.createProxy(WindowsApplication.class, null, capabilities, new Core());
    }

    public static  APPLICATION_OBJECT bootstrapWebApplication(Class type) {
        Core core = new Core();
        String driverUrl = ExtensionUtils.getDriverUrl(type, core.getConfig());
        core.getLogger().log(LogLevel.INFO,"Creating proxy for driver of type " + type.getSimpleName() + " on url: " + driverUrl);
        Map capabilities = Arrays.stream(type.getAnnotationsByType(Capability.class))
                .collect(ExtensionUtils.toCapabilitiesMap(core.getConfig()));
        return WebApplicationSupport.createProxy(type, driverUrl, capabilities, core);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy