Class ChromeBrowserTest

java.lang.Object
com.vaadin.testbench.TestBenchTestCase
com.vaadin.testbench.parallel.ParallelTest
All Implemented Interfaces:
com.vaadin.testbench.HasDriver, com.vaadin.testbench.HasElementQuery, com.vaadin.testbench.HasSearchContext, com.vaadin.testbench.HasTestBenchCommandExecutor
Direct Known Subclasses:
AbstractBrowserConsoleTest, 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
  • Constructor Details

    • ChromeBrowserTest

      public ChromeBrowserTest()
  • Method Details

    • setup

      public void setup() throws Exception
      Overrides:
      setup in class com.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: AbstractTestBenchTest
      Gets 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 LocalExecution annotation.

      The method AbstractTestBenchTest.getBrowsersToTest() delegates the logic to this method in case AbstractTestBenchTest.getLocalExecution() return value is an empty optional (i.e. the tests Hub is used).

      Overrides:
      getHubBrowsersToTest in class AbstractTestBenchTest
      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: AbstractTestBenchTest
      Gets browser capabilities for the provided browsers.
      Overrides:
      getBrowserCapabilities in class AbstractTestBenchTest
      Parameters:
      browsers - a browsers list
      Returns:
      the capabilities for the given browsers
    • customizeCapabilities

      protected List<org.openqa.selenium.remote.DesiredCapabilities> customizeCapabilities(List<org.openqa.selenium.remote.DesiredCapabilities> capabilities)