public class BrowserWebDriverContainer<SELF extends BrowserWebDriverContainer<SELF>>
extends org.testcontainers.containers.GenericContainer<SELF>
implements org.testcontainers.containers.traits.VncService, 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(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 |
getImageForCapabilities(org.openqa.selenium.Capabilities capabilities,
java.lang.String seleniumVersion) |
protected @NotNull java.util.Set<java.lang.Integer> |
getLivenessCheckPorts() |
java.lang.String |
getPassword() |
int |
getPort() |
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) |
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canEqual, containerIsCreated, containerIsStarting, copyFileFromContainer, copyFileFromContainer, copyFileToContainer, copyFileToContainer, createVolumeDirectory, doStart, equals, execInContainer, execInContainer, failed, fetchDockerDaemonInfo, finished, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDockerClient, getDockerDaemonInfo, 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, isPrivilegedMode, logger, setBinds, setCommand, setCommand, setCommandParts, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, succeeded, toString, waitingFor, waitUntilContainerStarted, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContainerNameaddFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindpublic BrowserWebDriverContainer()
public BrowserWebDriverContainer(java.lang.String dockerImageName)
dockerImageName - Name of the docker image to pullpublic 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>>public static java.lang.String getImageForCapabilities(org.openqa.selenium.Capabilities capabilities,
java.lang.String seleniumVersion)
public java.net.URL getSeleniumAddress()
public java.lang.String getVncAddress()
getVncAddress in interface org.testcontainers.containers.traits.VncServicepublic java.lang.String getPassword()
getPassword in interface org.testcontainers.containers.traits.VncServicepublic int getPort()
getPort in interface org.testcontainers.containers.traits.VncServiceprotected 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 withRecordingFileFactory(RecordingFileFactory recordingFileFactory)