Package com.vaadin.flow.testutil
Class ChromeBrowserTest
- java.lang.Object
-
- com.vaadin.testbench.TestBenchTestCase
-
- com.vaadin.testbench.parallel.ParallelTest
-
- com.vaadin.flow.testutil.TestBenchHelpers
-
- com.vaadin.flow.testutil.AbstractTestBenchTest
-
- com.vaadin.flow.testutil.ViewOrUITest
-
- com.vaadin.flow.testutil.ChromeBrowserTest
-
- All Implemented Interfaces:
com.vaadin.testbench.HasDriver,com.vaadin.testbench.HasElementQuery,com.vaadin.testbench.HasSearchContext,com.vaadin.testbench.HasTestBenchCommandExecutor
- Direct Known Subclasses:
AbstractComponentIT,AbstractViewTest
public class ChromeBrowserTest extends ViewOrUITest
Base class for TestBench tests to run locally in the Chrome browser.It is required to set system property with path to the driver to be able to run the test.
The test can be executed locally and on a test Hub. Chrome browser is used only if test is executed locally. The test Hub target browsers can be configured via
getHubBrowsersToTest().- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.testutil.AbstractTestBenchTest
AbstractTestBenchTest.ClientChecker
-
-
Field Summary
-
Fields inherited from class com.vaadin.flow.testutil.AbstractTestBenchTest
BROWSERSTACK_IDENTIFIER, BROWSERSTACK_IDENTIFIER_PROPERTY, SERVER_PORT, SERVER_PORT_PROPERTY_KEY, testName, USE_BROWSERSTACK, USE_BROWSERSTACK_PROPERTY, USE_HUB, USE_HUB_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ChromeBrowserTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<org.openqa.selenium.remote.DesiredCapabilities>customizeCapabilities(List<org.openqa.selenium.remote.DesiredCapabilities> capabilities)protected List<org.openqa.selenium.remote.DesiredCapabilities>getBrowserCapabilities(com.vaadin.testbench.parallel.Browser... browsers)Gets browser capabilities for the providedbrowsers.protected List<org.openqa.selenium.remote.DesiredCapabilities>getHubBrowsersToTest()Gets the browsers capabilities list to execute test on the tests Hub.voidsetup()protected voidupdateHeadlessChromeOptions(org.openqa.selenium.chrome.ChromeOptions chromeOptions)Allows modifying the chrome options to be used when running on a local Chrome.-
Methods inherited from class com.vaadin.flow.testutil.ViewOrUITest
getTestPath, getUIClass, getViewClass
-
Methods inherited from class com.vaadin.flow.testutil.AbstractTestBenchTest
checkIfServerAvailable, getBrowsersToTest, getCurrentHostAddress, getDeploymentHostname, getDeploymentPort, getHubHostname, getLocalExecution, getRootURL, getRunLocallyBrowser, getRunLocallyBrowserVersion, getTestURL, getTestURL, isClientRouter, open, open, openForEs6Url, openProduction, openProductionWithTiming, openUrl, verifyScreenshot, waitForClientRouter
-
Methods inherited from class com.vaadin.flow.testutil.TestBenchHelpers
assertEquals, blur, checkLogsForErrors, checkLogsForErrors, clickElementWithJs, clickElementWithJs, drag, dragAndDrop, dragElementOver, executeScript, getLogEntries, getScrollX, getScrollY, hasCssClass, isElementPresent, scrollBy, scrollIntoViewAndClick, scrollToElement, waitForDevServer, waitForElementNotPresent, waitForElementPresent, waitForElementVisible, waitUntilNot, waitUntilNot
-
Methods inherited from class com.vaadin.testbench.parallel.ParallelTest
getDefaultCapabilities, getDesiredCapabilities, getHubURL, getRunOnHub, setDesiredCapabilities
-
Methods inherited from class com.vaadin.testbench.TestBenchTestCase
concatUrl, findElement, findElements, getCommandExecutor, getContext, getDriver, setDriver, testBench, waitUntil, waitUntil, wrap
-
-
-
-
Method Detail
-
setup
public void setup() throws Exception- Overrides:
setupin classcom.vaadin.testbench.parallel.ParallelTest- Throws:
Exception
-
updateHeadlessChromeOptions
protected void updateHeadlessChromeOptions(org.openqa.selenium.chrome.ChromeOptions chromeOptions)
Allows modifying the chrome options to be used when running on a local Chrome.- Parameters:
chromeOptions- chrome options to use when running on a local Chrome
-
getHubBrowsersToTest
protected List<org.openqa.selenium.remote.DesiredCapabilities> getHubBrowsersToTest()
Description copied from class:AbstractTestBenchTestGets the browsers capabilities list to execute test on the tests Hub.This list will be used only for the tests Hub. Local test execution is managed by
LocalExecutionannotation.The method
AbstractTestBenchTest.getBrowsersToTest()delegates the logic to this method in caseAbstractTestBenchTest.getLocalExecution()return value is an empty optional (i.e. the tests Hub is used).- Overrides:
getHubBrowsersToTestin classAbstractTestBenchTest- Returns:
- the browsers capabilities list to execute test on the tests Hub
-
getBrowserCapabilities
protected List<org.openqa.selenium.remote.DesiredCapabilities> getBrowserCapabilities(com.vaadin.testbench.parallel.Browser... browsers)
Description copied from class:AbstractTestBenchTestGets browser capabilities for the providedbrowsers.- Overrides:
getBrowserCapabilitiesin classAbstractTestBenchTest- Parameters:
browsers- a browsers list- Returns:
- the capabilities for the given
browsers
-
-