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

com.nordstrom.automation.selenium.plugins.UiAutomator2Plugin Maven / Gradle / Ivy

Go to download

Selenium Foundation is an automation framework designed to extend and enhance the capabilities provided by Selenium (WebDriver).

There is a newer version: 28.3.1-s4
Show newest version
package com.nordstrom.automation.selenium.plugins;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import com.nordstrom.automation.selenium.SeleniumConfig;

public class UiAutomator2Plugin extends AbstractAppiumPlugin {

    public static final String DRIVER_NAME = "UiAutomator2";
    
    public UiAutomator2Plugin() {
        super(DRIVER_NAME);
    }

    private static final String CAPABILITIES =
            "{\"appium:automationName\":\"UiAutomator2\",\"platformName\":\"Android\"," +
             "\"browserName\":\"Chrome\",\"appium:deviceName\":\"Android Emulator\"}";
    
    private static final String BASELINE =
            "{\"appium:automationName\":\"UiAutomator2\",\"platformName\":\"Android\"," +
             "\"nord:options\":{\"personality\":\"UiAutomator2\"," +
                                "\"pluginClass\":\"com.nordstrom.automation.selenium.plugins.UiAutomator2Plugin\"}}";
    
    private static final Map PERSONALITIES;
    
    private static final String DRIVER_CLASS_NAME = "io.appium.java_client.android.AndroidDriver";
    
    static {
        Map personalities = new HashMap<>();
        personalities.put(DRIVER_NAME, BASELINE);
        PERSONALITIES = Collections.unmodifiableMap(personalities);
    }
    
    @Override
    public String getCapabilities(SeleniumConfig config) {
        return CAPABILITIES;
    }

    @Override
    public Map getPersonalities() {
        return PERSONALITIES;
    }

    @Override
    public String getDriverClassName() {
        return DRIVER_CLASS_NAME;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy