Package org.testcontainers.selenium
Class BrowserWebDriverContainer
java.lang.Object
org.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
org.testcontainers.selenium.BrowserWebDriverContainer
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.containers.Container<BrowserWebDriverContainer>,org.testcontainers.containers.ContainerState,org.testcontainers.containers.traits.LinkableContainer,org.testcontainers.containers.wait.strategy.WaitStrategyTarget,org.testcontainers.lifecycle.Startable,org.testcontainers.lifecycle.TestLifecycleAware
public class BrowserWebDriverContainer
extends org.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
implements org.testcontainers.lifecycle.TestLifecycleAware
A chrome/firefox/custom container based on SeleniumHQ's standalone container sets.
Supported images: selenium/standalone-chrome, selenium/standalone-firefox,
selenium/standalone-edge, selenium/standalone-chrome-debug, selenium/standalone-firefox-debug
Exposed ports: 4444
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
Fields inherited from class org.testcontainers.containers.GenericContainer
CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategyFields inherited from interface org.testcontainers.containers.ContainerState
STATE_HEALTHY -
Constructor Summary
ConstructorsConstructorDescriptionBrowserWebDriverContainer(String dockerImageName) Constructor taking a specific webdriver container name and tagBrowserWebDriverContainer(org.testcontainers.utility.DockerImageName dockerImageName) Constructor taking a specific webdriver container name and tag -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidprotected voidcontainerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) voidstop()withRecordingFileFactory(RecordingFileFactory recordingFileFactory) withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, File vncRecordingDirectory) withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, File vncRecordingDirectory, org.testcontainers.containers.VncRecordingContainer.VncRecordingFormat recordingFormat) Methods inherited from class org.testcontainers.containers.GenericContainer
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, containerIsCreated, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.testcontainers.containers.Container
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindMethods inherited from interface org.testcontainers.containers.ContainerState
copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunningMethods inherited from interface org.testcontainers.lifecycle.Startable
closeMethods inherited from interface org.testcontainers.lifecycle.TestLifecycleAware
beforeTest
-
Constructor Details
-
BrowserWebDriverContainer
Constructor taking a specific webdriver container name and tag- Parameters:
dockerImageName- Name of the selenium docker image
-
BrowserWebDriverContainer
public BrowserWebDriverContainer(org.testcontainers.utility.DockerImageName dockerImageName) Constructor taking a specific webdriver container name and tag- Parameters:
dockerImageName- Name of the selenium docker image
-
-
Method Details
-
getLivenessCheckPorts
- Overrides:
getLivenessCheckPortsin classorg.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
-
configure
protected void configure()- Overrides:
configurein classorg.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
-
getSeleniumAddress
-
getVncAddress
-
containerIsStarted
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) - Overrides:
containerIsStartedin classorg.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
-
afterTest
public void afterTest(org.testcontainers.lifecycle.TestDescription description, Optional<Throwable> throwable) - Specified by:
afterTestin interfaceorg.testcontainers.lifecycle.TestLifecycleAware
-
stop
public void stop()- Specified by:
stopin interfaceorg.testcontainers.lifecycle.Startable- Overrides:
stopin classorg.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
-
withRecordingMode
public BrowserWebDriverContainer withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, File vncRecordingDirectory) -
withRecordingMode
public BrowserWebDriverContainer withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, File vncRecordingDirectory, org.testcontainers.containers.VncRecordingContainer.VncRecordingFormat recordingFormat) -
withRecordingFileFactory
public BrowserWebDriverContainer withRecordingFileFactory(RecordingFileFactory recordingFileFactory)
-