Package org.richfaces.arquillian.browser

Source Code of org.richfaces.arquillian.browser.BrowserUtils

package org.richfaces.arquillian.browser;

import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

class BrowserUtils {

    static boolean isPhantomjs(WebDriver browser) {

        if (browser instanceof PhantomJSDriver) {
            return true;
        }

        if (browser instanceof RemoteWebDriver) {
            Capabilities capabilities = ((RemoteWebDriver) browser).getCapabilities();
            return DesiredCapabilities.phantomjs().getBrowserName().equals(capabilities.getBrowserName());
        }

        return false;
    }
}
TOP

Related Classes of org.richfaces.arquillian.browser.BrowserUtils

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.