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

at.willhaben.willtest.util.PlatformUtils Maven / Gradle / Ivy

There is a newer version: 3.1.10
Show newest version
package at.willhaben.willtest.util;

import at.willhaben.willtest.util.Environment;

import java.net.MalformedURLException;
import java.net.URL;

public class PlatformUtils {

    private static final String DEFAULT_PLATFORM_ANDROID = "Android";
    private static final String DEFAULT_PLATFORM_ANDROID_HUB = "Android-Hub";

    private static final String DEFAULT_PLATFORM_IOS = "IOS";

    private static final String DEFAULT_PLATFORM_DESKTOP = "Linux";
    private static final String DEFAULT_PLATFORM_WINDOWS = "Windows";
    private static final String SELENIUM_HUB_SYSTEM_PROPERTY_KEY = "seleniumHub";
    private static final String DEFAULT_PLATFORM_LINUX = "Linux";

    public static String getPlatform() {
        return Environment.getValue("platform", DEFAULT_PLATFORM_DESKTOP);
    }

    public static boolean isAndroid() {
        String platform = getPlatform();
        return platform.equals(DEFAULT_PLATFORM_ANDROID) || platform.equals(DEFAULT_PLATFORM_ANDROID_HUB);
    }

    public static boolean isIOS() {
        return getPlatform().equals(DEFAULT_PLATFORM_IOS);
    }

    public static boolean isLinux() {
        return getPlatform().equals(DEFAULT_PLATFORM_LINUX);
    }

    public static boolean isWindows() {
        return getPlatform().equals(DEFAULT_PLATFORM_WINDOWS);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy