public class BrowserWebDriverContainer<SELF extends BrowserWebDriverContainer<SELF>>
extends org.testcontainers.containers.GenericContainer<SELF>
implements org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.lifecycle.TestLifecycleAware
The container should expose Selenium remote control protocol and VNC.
| Modifier and Type | Class and Description |
|---|---|
static class |
BrowserWebDriverContainer.VncRecordingMode |
| Constructor and Description |
|---|
BrowserWebDriverContainer() |
BrowserWebDriverContainer(org.testcontainers.utility.DockerImageName dockerImageName)
Constructor taking a specific webdriver container name and tag
|
BrowserWebDriverContainer(java.lang.String dockerImageName)
Constructor taking a specific webdriver container name and tag
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterTest(org.testcontainers.lifecycle.TestDescription description,
java.util.Optional<java.lang.Throwable> throwable) |
protected void |
configure() |
protected void |
containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) |
static java.lang.String |
getDockerImageForCapabilities(org.openqa.selenium.Capabilities capabilities,
java.lang.String seleniumVersion)
Deprecated.
note that this method is deprecated and may be removed in the future. The no-args
BrowserWebDriverContainer() combined with the
withCapabilities(Capabilities) method should be considered. A decision on
removal of this deprecated method will be taken at a future date. |
protected @NotNull java.util.Set<java.lang.Integer> |
getLivenessCheckPorts() |
java.lang.String |
getPassword()
Deprecated.
|
int |
getPort()
Deprecated.
|
java.net.URL |
getSeleniumAddress() |
java.lang.String |
getVncAddress() |
org.openqa.selenium.remote.RemoteWebDriver |
getWebDriver()
Obtain a RemoteWebDriver instance that is bound to an instance of the browser running inside a new container.
|
void |
stop() |
SELF |
withCapabilities(org.openqa.selenium.Capabilities capabilities) |
SELF |
withDesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities capabilities)
Deprecated.
Use withCapabilities(Capabilities capabilities) instead:
withCapabilities(new FirefoxOptions())
|
SELF |
withLinkToContainer(org.testcontainers.containers.traits.LinkableContainer otherContainer,
java.lang.String alias)
Deprecated.
Links are deprecated (see #465). Please use
Network features instead. |
SELF |
withRecordingFileFactory(RecordingFileFactory recordingFileFactory) |
SELF |
withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode,
java.io.File vncRecordingDirectory) |
SELF |
withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode,
java.io.File vncRecordingDirectory,
org.testcontainers.containers.VncRecordingContainer.VncRecordingFormat recordingFormat) |
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, containerIsCreated, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, failed, finished, 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, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, succeeded, 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, withWorkingDirectoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContainerNameaddFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindcopyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunningpublic BrowserWebDriverContainer()
public BrowserWebDriverContainer(java.lang.String dockerImageName)
dockerImageName - Name of the selenium docker imagepublic BrowserWebDriverContainer(org.testcontainers.utility.DockerImageName dockerImageName)
dockerImageName - Name of the selenium docker imagepublic SELF withCapabilities(org.openqa.selenium.Capabilities capabilities)
@Deprecated public SELF withDesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities capabilities)
capabilities - DesiredCapabilities@NotNull protected @NotNull java.util.Set<java.lang.Integer> getLivenessCheckPorts()
getLivenessCheckPorts in class org.testcontainers.containers.GenericContainer<SELF extends BrowserWebDriverContainer<SELF>>protected void configure()
configure in class org.testcontainers.containers.GenericContainer<SELF extends BrowserWebDriverContainer<SELF>>@Deprecated
public static java.lang.String getDockerImageForCapabilities(org.openqa.selenium.Capabilities capabilities,
java.lang.String seleniumVersion)
BrowserWebDriverContainer() combined with the
withCapabilities(Capabilities) method should be considered. A decision on
removal of this deprecated method will be taken at a future date.capabilities - a Capabilities object for either Chrome or FirefoxseleniumVersion - the version of selenium in usepublic java.net.URL getSeleniumAddress()
public java.lang.String getVncAddress()
@Deprecated public java.lang.String getPassword()
@Deprecated public int getPort()
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
containerIsStarted in class org.testcontainers.containers.GenericContainer<SELF extends BrowserWebDriverContainer<SELF>>public org.openqa.selenium.remote.RemoteWebDriver getWebDriver()
All containers and drivers will be automatically shut down after the test method finishes (if used as a @Rule) or the test class (if used as a @ClassRule)
public void afterTest(org.testcontainers.lifecycle.TestDescription description,
java.util.Optional<java.lang.Throwable> throwable)
afterTest in interface org.testcontainers.lifecycle.TestLifecycleAwarepublic void stop()
stop in interface org.testcontainers.lifecycle.Startablestop in class org.testcontainers.containers.GenericContainer<SELF extends BrowserWebDriverContainer<SELF>>@Deprecated public SELF withLinkToContainer(org.testcontainers.containers.traits.LinkableContainer otherContainer, java.lang.String alias)
Network features instead.otherContainer - the container rule to link toalias - the alias (hostname) that this other container should be referred to bypublic SELF withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, java.io.File vncRecordingDirectory)
public SELF withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, java.io.File vncRecordingDirectory, org.testcontainers.containers.VncRecordingContainer.VncRecordingFormat recordingFormat)
public SELF withRecordingFileFactory(RecordingFileFactory recordingFileFactory)