Class BrowserWebDriverContainer<SELF extends BrowserWebDriverContainer<SELF>>

java.lang.Object
org.testcontainers.containers.FailureDetectingExternalResource
org.testcontainers.containers.GenericContainer<SELF>
software.xdev.testcontainers.selenium.containers.browser.BrowserWebDriverContainer<SELF>
All Implemented Interfaces:
AutoCloseable, org.junit.rules.TestRule, org.testcontainers.containers.Container<SELF>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.containers.wait.strategy.WaitStrategyTarget, org.testcontainers.lifecycle.Startable, org.testcontainers.lifecycle.TestLifecycleAware
Direct Known Subclasses:
CapabilitiesBrowserWebDriverContainer

public class BrowserWebDriverContainer<SELF extends BrowserWebDriverContainer<SELF>> extends org.testcontainers.containers.GenericContainer<SELF> implements org.testcontainers.lifecycle.TestLifecycleAware
A chrome/firefox/custom container based on SeleniumHQ's standalone container sets.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
    • CHROME_IMAGE

      protected static final org.testcontainers.utility.DockerImageName CHROME_IMAGE
    • FIREFOX_IMAGE

      protected static final org.testcontainers.utility.DockerImageName FIREFOX_IMAGE
    • EDGE_IMAGE

      protected static final org.testcontainers.utility.DockerImageName EDGE_IMAGE
    • WORKING_BROWSER_IMAGES_TRANSLATION

      protected static final Map<org.testcontainers.utility.DockerImageName,String> WORKING_BROWSER_IMAGES_TRANSLATION
    • SELENIUM_PORT

      public static final int SELENIUM_PORT
      See Also:
    • VNC_PORT

      public static final int VNC_PORT
      See Also:
    • NO_VNC_PORT

      public static final int NO_VNC_PORT
      See Also:
    • DEFAULT_VNC_PASSWORD

      public static final String DEFAULT_VNC_PASSWORD
      See Also:
    • TC_TEMP_DIR_PREFIX

      protected static final String TC_TEMP_DIR_PREFIX
      See Also:
    • mapTimezoneIntoContainer

      protected boolean mapTimezoneIntoContainer
    • validateImageEnabled

      protected boolean validateImageEnabled
    • validateImageGetTimeout

      protected Duration validateImageGetTimeout
    • disableVNC

      protected boolean disableVNC
    • exposeVNCPort

      protected boolean exposeVNCPort
    • enableNoVNC

      protected boolean enableNoVNC
    • recordingContainerSupplier

      protected Function<SELF extends BrowserWebDriverContainer<SELF>,RecordingContainer<?>> recordingContainerSupplier
    • recordingContainer

      protected RecordingContainer<?> recordingContainer
    • startRecordingContainerManually

      protected boolean startRecordingContainerManually
    • recordingMode

      protected BrowserWebDriverContainer.RecordingMode recordingMode
    • recordingDirectory

      protected Path recordingDirectory
    • testRecordingFileNameFactory

      protected BrowserWebDriverContainer.TestRecordingFileNameFactory testRecordingFileNameFactory
    • recordingSaveTimeout

      protected Duration recordingSaveTimeout
  • Constructor Details

    • BrowserWebDriverContainer

      public BrowserWebDriverContainer(String dockerImageName)
    • BrowserWebDriverContainer

      public BrowserWebDriverContainer(org.testcontainers.utility.DockerImageName dockerImageName)
  • Method Details

    • getDefaultWaitStrategy

      protected org.testcontainers.containers.wait.strategy.WaitStrategy getDefaultWaitStrategy()
    • withMapTimezoneIntoContainer

      public SELF withMapTimezoneIntoContainer(boolean mapTimezoneIntoContainer)
    • withValidateImage

      public SELF withValidateImage(boolean validateImage)
    • withValidateImageGetTimeout

      public SELF withValidateImageGetTimeout(Duration validateImageGetTimeout)
    • withDisableVNC

      public SELF withDisableVNC(boolean disableVNC)
    • withExposeVNCPort

      public SELF withExposeVNCPort(boolean exposeVNCPort)
    • withEnableNoVNC

      public SELF withEnableNoVNC(boolean enableNoVNC)
    • withRecordingContainerSupplier

      public SELF withRecordingContainerSupplier(Function<SELF,RecordingContainer<?>> recordingContainerSupplier)
    • withStartRecordingContainerManually

      public SELF withStartRecordingContainerManually(boolean startRecordingContainerManually)
    • withRecordingMode

      public SELF withRecordingMode(BrowserWebDriverContainer.RecordingMode recordingMode)
    • withRecordingDirectory

      public SELF withRecordingDirectory(Path recordingDirectory)
    • withTestRecordingFileNameFactory

      public SELF withTestRecordingFileNameFactory(BrowserWebDriverContainer.TestRecordingFileNameFactory testRecordingFileNameFactory)
    • withRecordingSaveTimeout

      public SELF withRecordingSaveTimeout(Duration recordingSaveTimeout)
    • configure

      protected void configure()
      Overrides:
      configure in class org.testcontainers.containers.GenericContainer<SELF extends BrowserWebDriverContainer<SELF>>
    • configureRecording

      protected void configureRecording()
    • configureTimezone

      protected void configureTimezone()
    • configureShm

      protected void configureShm()
    • configureVNC

      protected void configureVNC()
    • validateImage

      protected void validateImage()
    • validateImageOrPickAlternative

      protected String validateImageOrPickAlternative(org.testcontainers.utility.DockerImageName initial)
    • getVncAddress

      public String getVncAddress()
    • getNoVncAddress

      public String getNoVncAddress()
    • getSeleniumAddressURI

      public URI getSeleniumAddressURI()
    • stop

      public void stop()
      Specified by:
      stop in interface org.testcontainers.lifecycle.Startable
      Overrides:
      stop in class org.testcontainers.containers.GenericContainer<SELF extends BrowserWebDriverContainer<SELF>>
    • afterTest

      public void afterTest(org.testcontainers.lifecycle.TestDescription description, Optional<Throwable> throwable)
      Specified by:
      afterTest in interface org.testcontainers.lifecycle.TestLifecycleAware
    • retainRecordingIfNeeded

      protected void retainRecordingIfNeeded(String testName, boolean succeeded)
    • containerIsStarted

      protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo, boolean reused)
      Overrides:
      containerIsStarted in class org.testcontainers.containers.GenericContainer<SELF extends BrowserWebDriverContainer<SELF>>
    • startRecordingContainer

      public void startRecordingContainer()
    • stopRecordingContainer

      protected void stopRecordingContainer()
    • getContainerNameCleaned

      public String getContainerNameCleaned()