public abstract class AbstractTestBenchTest extends TestBenchHelpers
| Modifier and Type | Field and Description |
|---|---|
static String |
BROWSERSTACK_IDENTIFIER |
static String |
BROWSERSTACK_IDENTIFIER_PROPERTY |
static int |
SERVER_PORT
Server port resolved by system property
"serverPort" or the default
.
|
static String |
SERVER_PORT_PROPERTY_KEY
System property key for the test server port.
|
org.junit.rules.TestName |
testName |
static boolean |
USE_BROWSERSTACK |
static String |
USE_BROWSERSTACK_PROPERTY |
static boolean |
USE_HUB |
static String |
USE_HUB_PROPERTY |
| Constructor and Description |
|---|
AbstractTestBenchTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkIfServerAvailable()
Checks that server is available before running the actual test.
|
protected List<org.openqa.selenium.remote.DesiredCapabilities> |
getBrowserCapabilities(com.vaadin.testbench.parallel.Browser... browsers)
Gets browser capabilities for the provided
browsers. |
List<org.openqa.selenium.remote.DesiredCapabilities> |
getBrowsersToTest()
Produces a collection of browsers to run the test on.
|
protected String |
getCurrentHostAddress()
Returns host address that can be targeted from the outside, like from a
test hub.
|
protected String |
getDeploymentHostname()
Used to determine what URL to initially open for the test.
|
protected int |
getDeploymentPort()
Used to determine what port the test is running on.
|
protected List<org.openqa.selenium.remote.DesiredCapabilities> |
getHubBrowsersToTest()
Gets the browsers capabilities list to execute test on the tests Hub.
|
protected String |
getHubHostname() |
protected Optional<LocalExecution> |
getLocalExecution()
Gets local execution (
LocalExecution) configuration for the test. |
protected String |
getRootURL()
Returns the URL to the root of the server, e.g.
|
protected com.vaadin.testbench.parallel.Browser |
getRunLocallyBrowser() |
protected String |
getRunLocallyBrowserVersion() |
protected abstract String |
getTestPath()
Gets the absolute path to the test, starting with a "/".
|
protected String |
getTestURL(String... parameters)
Returns the URL to be used for the test.
|
static String |
getTestURL(String rootUrl,
String testPath,
String... parameters)
Returns the URL to be used for the test.
|
protected void |
open() |
protected void |
open(String... parameters) |
protected void |
openForEs6Url(String... parameters) |
protected void |
openProduction(String... parameters) |
protected void |
openProductionWithTiming(String... parameters) |
protected void |
openUrl(String targetUrl,
String... parameters) |
protected void |
verifyScreenshot(String identifier)
Compares the given reference screenshot to the current and fails the test
if it doesn't match.
|
assertEquals, blur, checkLogsForErrors, checkLogsForErrors, clickElementWithJs, clickElementWithJs, drag, dragAndDrop, dragElementOver, executeScript, getLogEntries, getScrollX, getScrollY, hasCssClass, isElementPresent, scrollBy, scrollIntoViewAndClick, scrollToElement, waitForDevServer, waitForElementNotPresent, waitForElementPresent, waitForElementVisible, waitUntilNot, waitUntilNotgetDefaultCapabilities, getDesiredCapabilities, getHubURL, getRunOnHub, setDesiredCapabilities, setupconcatUrl, findElement, findElements, getCommandExecutor, getContext, getDriver, setDriver, testBench, waitUntil, waitUntil, wrappublic static final String SERVER_PORT_PROPERTY_KEY
public static final int SERVER_PORT
public static final String USE_HUB_PROPERTY
public static final boolean USE_HUB
public static final String USE_BROWSERSTACK_PROPERTY
public static final boolean USE_BROWSERSTACK
public static final String BROWSERSTACK_IDENTIFIER_PROPERTY
public static final String BROWSERSTACK_IDENTIFIER
public org.junit.rules.TestName testName
public void checkIfServerAvailable()
protected void open()
protected void open(String... parameters)
protected void openProduction(String... parameters)
protected void openProductionWithTiming(String... parameters)
protected void openForEs6Url(String... parameters)
protected String getTestURL(String... parameters)
parameters - query string parameters to add to the urlprotected abstract String getTestPath()
getRootURL() for the
full test URL.protected String getRootURL()
protected void verifyScreenshot(String identifier) throws IOException
identifier - the identifier to use for the screenshot, becomes part of the
screenshot name in the
module-folder/reference-screenshots/ folderIOException - if there was a problem accessing the reference imagepublic List<org.openqa.selenium.remote.DesiredCapabilities> getBrowsersToTest()
ParallelTest.setDesiredCapabilities(DesiredCapabilities) is invoked with the
value returned by this method.protected List<org.openqa.selenium.remote.DesiredCapabilities> getHubBrowsersToTest()
This list will be used only for the tests Hub. Local test execution is
managed by LocalExecution annotation.
The method getBrowsersToTest() delegates the logic to this
method in case getLocalExecution() return value is an empty
optional (i.e. the tests Hub is used).
protected List<org.openqa.selenium.remote.DesiredCapabilities> getBrowserCapabilities(com.vaadin.testbench.parallel.Browser... browsers)
browsers.browsers - a browsers listbrowsersprotected String getDeploymentHostname()
protected String getCurrentHostAddress()
RuntimeException - if host name could not be determined or
SocketException was caught during the determination.protected int getDeploymentPort()
protected String getHubHostname()
getHubHostname in class com.vaadin.testbench.parallel.ParallelTestprotected com.vaadin.testbench.parallel.Browser getRunLocallyBrowser()
getRunLocallyBrowser in class com.vaadin.testbench.parallel.ParallelTestprotected String getRunLocallyBrowserVersion()
getRunLocallyBrowserVersion in class com.vaadin.testbench.parallel.ParallelTestprotected Optional<LocalExecution> getLocalExecution()
LocalExecution) configuration for the test.
If this method return an empty optional then test with be run on the test Hub
LocalExecutionpublic static String getTestURL(String rootUrl, String testPath, String... parameters)
parameters - query string parameters to add to the urlrootUrl - the root URL of the server (hostname + port)testPath - the path of the testCopyright © 2000–2025 Vaadin Ltd. All rights reserved.