Package com.vaadin.testbench.parallel
Class BrowserUtil
java.lang.Object
com.vaadin.testbench.parallel.BrowserUtil
Provides helper method for selecting the browser to run on
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.openqa.selenium.remote.DesiredCapabilitieschrome()Gets the capabilities for Chromestatic org.openqa.selenium.remote.DesiredCapabilitiesedge()Gets the capabilities for Edgestatic org.openqa.selenium.remote.DesiredCapabilitiesfirefox()Gets the capabilities for Firefoxstatic TestBenchBrowserFactoryGets the BrowserFactory used to generate new DesiredCapabilitiesstatic StringgetBrowserIdentifier(org.openqa.selenium.Capabilities capabilities) Returns a human readable identifier of the given browser.static StringgetPlatform(org.openqa.selenium.Capabilities capabilities) Returns a human readable identifier of the platform described by the given capabilities.static booleanisChrome(org.openqa.selenium.Capabilities capabilities) static booleanisEdge(org.openqa.selenium.Capabilities capabilities) static booleanisFirefox(org.openqa.selenium.Capabilities capabilities) static booleanisSafari(org.openqa.selenium.Capabilities capabilities) static org.openqa.selenium.remote.DesiredCapabilitiessafari()Gets the capabilities for Safaristatic voidsetBrowserFactory(TestBenchBrowserFactory browserFactory) Sets new BrowserFactory to generate default DesiredCapabilities for each Browser.
Extend BrowserFactory and override its methods in order to add default version, platform or other capabilities.
-
Constructor Details
-
BrowserUtil
public BrowserUtil()
-
-
Method Details
-
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
-
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
-
isEdge
public static boolean isEdge(org.openqa.selenium.Capabilities capabilities) - Parameters:
capabilities- The capabilities to check- Returns:
- true if the capabilities refer to Edge, false otherwise
-
isChrome
public static boolean isChrome(org.openqa.selenium.Capabilities capabilities) - Parameters:
capabilities- The capabilities to check- Returns:
- true if the capabilities refer to Chrome, false otherwise
-
isSafari
public static boolean isSafari(org.openqa.selenium.Capabilities capabilities) - Parameters:
capabilities- The capabilities to check- Returns:
- true if the capabilities refer to Safari, false otherwise
-
isFirefox
public static boolean isFirefox(org.openqa.selenium.Capabilities capabilities) - Parameters:
capabilities- The capabilities to check- Returns:
- true if the capabilities refer to Firefox, false otherwise
-
getBrowserIdentifier
Returns a human readable identifier of the given browser. Used for test naming and screenshots- Parameters:
capabilities- to obtain the browser identifier from- Returns:
- a human readable string describing the capabilities
-
getPlatform
Returns a human readable identifier of the platform described by the given capabilities. Used mainly for screenshots- Parameters:
capabilities- to obtain the platform from- Returns:
- a human readable string describing the platform
-
setBrowserFactory
Sets new BrowserFactory to generate default DesiredCapabilities for each Browser.
Extend BrowserFactory and override its methods in order to add default version, platform or other capabilities.- Parameters:
browserFactory- BrowserFactory instance to use to generate default DesiredCapabilities
-
getBrowserFactory
Gets the BrowserFactory used to generate new DesiredCapabilities- Returns:
- BrowserFactory used to generate new DesiredCapabilities
-