Skip to content

Commit e6d50d8

Browse files
kiviewAnna Chernyshova
andcommitted
Start updating the Selenium docs
Co-authored-by: Anna Chernyshova <[email protected]>
1 parent e1dd7cb commit e6d50d8

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

docs/modules/webdriver_containers.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ from SeleniumHQ's [docker-selenium](https://github.com/SeleniumHQ/docker-seleniu
55

66
## Benefits
77

8-
* Fully compatible with Selenium 2/Webdriver tests, by providing a `RemoteWebDriver` instance
8+
* Fully compatible with Selenium 3 & 4 tests, by providing a `RemoteWebDriver` instance
99
* No need to have specific web browsers, or even a desktop environment, installed on test servers. The only dependency
1010
is a working Docker installation and your Java JUnit test suite.
1111
* Browsers are always launched from a fixed, clean image. This means no configuration drift from user changes or
1212
automatic browser upgrades.
13-
* Compatibility between browser version and the Selenium API is assured: a compatible version of the browser docker
14-
images will be automatically selected to match the version of `selenium-api-*.jar` on the classpath
15-
* Additionally the use of a clean browser prevents leakage of cookies, cached data or other state between tests.
13+
* Additionally, the use of a clean browser prevents leakage of cookies, cached data or other state between tests.
1614
* **VNC screen recording**: Testcontainers can automatically record video of test runs (optionally capturing just
1715
failing tests)
1816

@@ -102,18 +100,17 @@ testImplementation "org.testcontainers:selenium:{{latest_version}}"
102100
```
103101

104102
!!! hint
105-
Adding this Testcontainers library JAR will not automatically add a Selenium Webdriver JAR to your project. You should ensure that your project also has suitable Selenium dependencies in place, for example:
103+
Adding this Testcontainers library JAR will not automatically add a Selenium Webdriver JAR to your project.
104+
You should ensure that your project also has suitable Selenium dependencies in place, for example:
106105

107106
```groovy tab='Gradle'
108-
compile "org.seleniumhq.selenium:selenium-remote-driver:3.141.59"
107+
implementation 'org.seleniumhq.selenium:selenium-java:4.1.1'
109108
```
110109

111110
```xml tab='Maven'
112111
<dependency>
113112
<groupId>org.seleniumhq.selenium</groupId>
114-
<artifactId>selenium-remote-driver</artifactId>
115-
<version>3.141.59</version>
113+
<artifactId>selenium-java</artifactId>
114+
<version>4.1.1</version>
116115
</dependency>
117116
```
118-
119-
Testcontainers will try and match the version of the Dockerized browser to whichever version of Selenium is found on the classpath

modules/selenium/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ description = "Testcontainers :: Selenium"
33
dependencies {
44
api project(':testcontainers')
55

6-
implementation 'org.seleniumhq.selenium:selenium-remote-driver:4.0.0'
7-
implementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.0.0'
8-
implementation 'org.seleniumhq.selenium:selenium-firefox-driver:4.0.0'
9-
implementation 'org.seleniumhq.selenium:selenium-support:4.0.0'
6+
implementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.1.0'
107

8+
testImplementation 'org.seleniumhq.selenium:selenium-firefox-driver:4.1.0'
119
testImplementation 'org.mortbay.jetty:jetty:6.1.26'
1210
testImplementation project(':nginx')
1311
testImplementation 'org.rnorth.visible-assertions:visible-assertions:2.1.2'

modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
package org.testcontainers.containers;
22

3-
import static java.time.temporal.ChronoUnit.SECONDS;
4-
53
import com.github.dockerjava.api.command.InspectContainerResponse;
64
import com.github.dockerjava.api.model.AccessMode;
75
import com.github.dockerjava.api.model.Bind;
86
import com.github.dockerjava.api.model.Volume;
97
import com.google.common.collect.ImmutableSet;
10-
import java.io.File;
11-
import java.io.IOException;
12-
import java.net.MalformedURLException;
13-
import java.net.URL;
14-
import java.nio.file.Files;
15-
import java.time.Duration;
16-
import java.util.Optional;
17-
import java.util.Set;
18-
import java.util.concurrent.TimeUnit;
198
import org.jetbrains.annotations.NotNull;
209
import org.jetbrains.annotations.Nullable;
2110
import org.openqa.selenium.Capabilities;
2211
import org.openqa.selenium.chrome.ChromeOptions;
23-
import org.openqa.selenium.remote.BrowserType;
2412
import org.openqa.selenium.remote.DesiredCapabilities;
2513
import org.openqa.selenium.remote.RemoteWebDriver;
2614
import org.rnorth.ducttape.timeouts.Timeouts;
@@ -37,6 +25,18 @@
3725
import org.testcontainers.lifecycle.TestLifecycleAware;
3826
import org.testcontainers.utility.DockerImageName;
3927

28+
import java.io.File;
29+
import java.io.IOException;
30+
import java.net.MalformedURLException;
31+
import java.net.URL;
32+
import java.nio.file.Files;
33+
import java.time.Duration;
34+
import java.util.Optional;
35+
import java.util.Set;
36+
import java.util.concurrent.TimeUnit;
37+
38+
import static java.time.temporal.ChronoUnit.SECONDS;
39+
4040
/**
4141
* A chrome/firefox/custom container based on SeleniumHQ's standalone container sets.
4242
* <p>

0 commit comments

Comments
 (0)