public class ParallelTest extends TestBenchTestCase
ParallelTest
if they are to be run in
several browser configurations. For each browser configuration, a
WebDriver
is properly created with the desired configuration.
You can configure your tests to be run in Sauce Labs. See details at https://wiki.saucelabs.com and https://github.com/vaadin/testbench-demo.
Modifier and Type | Field and Description |
---|---|
ScreenshotOnFailureRule |
screenshotOnFailure |
driver, maxAttempts, testbenchVersion
Constructor and Description |
---|
ParallelTest() |
Modifier and Type | Method and Description |
---|---|
static List<org.openqa.selenium.remote.DesiredCapabilities> |
getDefaultCapabilities() |
protected org.openqa.selenium.remote.DesiredCapabilities |
getDesiredCapabilities()
Gets the
DesiredCapabilities (usually browser name and version) |
protected String |
getHubHostname()
Returns the hostname of the hub where test is to be run on.
|
protected String |
getHubURL()
Returns the complete URL of the hub where the tests will be run on.
|
protected Browser |
getRunLocallyBrowser() |
protected String |
getRunLocallyBrowserVersion() |
protected RunOnHub |
getRunOnHub(Class<?> klass) |
void |
setDesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)
Sets the requested
DesiredCapabilities (usually browser name and
version) |
void |
setup()
Sets the driver for this test instance.
|
concatUrl, executeScript, findElement, findElements, getCommandExecutor, getContext, getDriver, setDriver, testBench, waitUntil, waitUntil, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
$, $
public ScreenshotOnFailureRule screenshotOnFailure
protected String getHubURL()
Returns the complete URL of the hub where the tests will be run on. Used
by setup()
, for the creation of the WebDriver
.
This method uses getHubHostname()
to build the complete address
of the Hub. Override in order to define a different hub address.
You can provide sauce.user and sauce.sauceAccessKey system properties or SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables to run the tests in Sauce Labs. If both system property and environment variable is defined, system property is prioritised.
setup()
, for the creation of the WebDriver
.protected String getHubHostname()
Returns the hostname of the hub where test is to be run on. If unit test
is annotated by RunLocally
, this method returns localhost.
Otherwise, it will return the host defined by the
com.vaadin.testbench.Parameters.hubHostname
system parameter or
the host defined using a RunOnHub
annotation.
This method is used by getHubURL()
to get the full URL of the
hub to run tests on.
public void setup() throws Exception
Sets the driver for this test instance. Uses
SetupDriver.setupRemoteDriver(String)
or
SetupDriver.setupLocalDriver(Browser)
according to the
annotations found in current test case.
RunOnHub
annotation can be used on the test case class to define
a test hub's hostname for the driver to connect to it.
RunLocally
annotation can be used on the test case class to force
the driver to connect to localhost (RunLocally
annotation
overrides RunOnHub
annotation).
Exception
- if unable to instantiate WebDriver
protected RunOnHub getRunOnHub(Class<?> klass)
RunOnHub
annotation of current Class, or
null if annotation is not present.protected Browser getRunLocallyBrowser()
RunLocally
annotation of current
Class, or null if annotation is not present.protected String getRunLocallyBrowserVersion()
RunLocally
annotation of current
Class, or empty empty String if annotation is not present.public static List<org.openqa.selenium.remote.DesiredCapabilities> getDefaultCapabilities()
BrowserConfiguration
method was foundpublic void setDesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)
DesiredCapabilities
(usually browser name and
version)desiredCapabilities
- protected org.openqa.selenium.remote.DesiredCapabilities getDesiredCapabilities()
DesiredCapabilities
(usually browser name and version)Copyright © 2018. All rights reserved.