com.vaadin.testbench.parallel.
Class BrowserUtil
- java.lang.Object
-
- com.vaadin.testbench.parallel.BrowserUtil
-
public class BrowserUtil extends Object
Provides helper method for selecting the browser to run on
-
-
Constructor Summary
Constructors Constructor and Description BrowserUtil()
-
Method Summary
All Methods Modifier and Type Method and Description static org.openqa.selenium.remote.DesiredCapabilities
chrome()
Gets the capabilities for Chrome
static org.openqa.selenium.remote.DesiredCapabilities
edge()
Gets the capabilities for Edge
static org.openqa.selenium.remote.DesiredCapabilities
firefox()
Gets the capabilities for Firefox
static TestBenchBrowserFactory
getBrowserFactory()
Gets the BrowserFactory used to generate new DesiredCapabilities
static String
getBrowserIdentifier(org.openqa.selenium.Capabilities capabilities)
Returns a human readable identifier of the given browser.
static String
getPlatform(org.openqa.selenium.Capabilities capabilities)
Returns a human readable identifier of the platform described by the given capabilities.
static org.openqa.selenium.remote.DesiredCapabilities
ie11()
Gets the capabilities for Internet Explorer 11
static boolean
isChrome(org.openqa.selenium.Capabilities capabilities)
static boolean
isEdge(org.openqa.selenium.Capabilities capabilities)
static boolean
isFirefox(org.openqa.selenium.Capabilities capabilities)
static boolean
isIE(org.openqa.selenium.Capabilities capabilities)
static boolean
isIE(org.openqa.selenium.Capabilities capabilities, int version)
static boolean
isSafari(org.openqa.selenium.Capabilities capabilities)
static org.openqa.selenium.remote.DesiredCapabilities
safari()
Gets the capabilities for Safari
-
-
-
Method Detail
-
safari
public static org.openqa.selenium.remote.DesiredCapabilities safari()
Gets the capabilities for Safari
Returns:
an object describing the capabilities required for running a test on Safari
-
chrome
public static org.openqa.selenium.remote.DesiredCapabilities chrome()
Gets the capabilities for Chrome
Returns:
an object describing the capabilities required for running a test on Chrome
-
firefox
public static org.openqa.selenium.remote.DesiredCapabilities firefox()
Gets the capabilities for Firefox
Returns:
an object describing the capabilities required for running a test on Firefox
-
ie11
public static org.openqa.selenium.remote.DesiredCapabilities ie11()
Gets the capabilities for Internet Explorer 11
Returns:
an object describing the capabilities required for running a test on Internet Explorer 11
-
edge
public static org.openqa.selenium.remote.DesiredCapabilities edge()
Gets the capabilities for Edge
Returns:
an object describing the capabilities required for running a test on Edge
-
isIE
public static boolean isIE(org.openqa.selenium.Capabilities capabilities)
Parameters:
capabilities
- The capabilities to checkReturns:
true if the capabilities refer to Internet Explorer, false otherwise
-
isIE
public static boolean isIE(org.openqa.selenium.Capabilities capabilities, int version)
Parameters:
capabilities
- The capabilities to checkversion
- Version number as an integerReturns:
true if the capabilities refer to correct version of Internet Explorer, false otherwise
-
isEdge
public static boolean isEdge(org.openqa.selenium.Capabilities capabilities)
Parameters:
capabilities
- The capabilities to checkReturns:
true if the capabilities refer to Edge, false otherwise
-
isChrome
public static boolean isChrome(org.openqa.selenium.Capabilities capabilities)
Parameters:
capabilities
- The capabilities to checkReturns:
true if the capabilities refer to Chrome, false otherwise
-
isSafari
public static boolean isSafari(org.openqa.selenium.Capabilities capabilities)
Parameters:
capabilities
- The capabilities to checkReturns:
true if the capabilities refer to Safari, false otherwise
-
isFirefox
public static boolean isFirefox(org.openqa.selenium.Capabilities capabilities)
Parameters:
capabilities
- The capabilities to checkReturns:
true if the capabilities refer to Firefox, false otherwise
-
getBrowserIdentifier
public static String getBrowserIdentifier(org.openqa.selenium.Capabilities capabilities)
Returns a human readable identifier of the given browser. Used for test naming and screenshots
Parameters:
capabilities
-Returns:
a human readable string describing the capabilities
-
getPlatform
public static String getPlatform(org.openqa.selenium.Capabilities capabilities)
Returns a human readable identifier of the platform described by the given capabilities. Used mainly for screenshots
Parameters:
capabilities
-Returns:
a human readable string describing the platform
-
getBrowserFactory
public static TestBenchBrowserFactory getBrowserFactory()
Gets the BrowserFactory used to generate new DesiredCapabilities
Returns:
BrowserFactory used to generate new DesiredCapabilities
-
-