Skip to content

Commit ca45d3c

Browse files
committed
Update documentation in readiness for v0.9.8 release
1 parent bdb81b9 commit ca45d3c

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

Diff for: docs/ROADMAP.md

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Exact future features aren't set in stone, but here are the principles we should
1717
This list may cross over with the [issues list](https://github.com/testcontainers/testcontainers-java/issues) some times.
1818

1919
* **Better documentation and log messages**. We need this.
20-
* **Support docker machine**. Docker machine will replace boot2docker and thus we should support it for users on OS X.
2120
* **Database state snapshotting**. Some projects have complex test data that is time consuming to reload. This means that either testing takes a very long time (test data has to be reloaded often), or tests aren't sufficiently independent (test data is not reloaded and therefore tests aren't independent). Testcontainers should provide a way to snapshot DB state and quickly reload that state. Docker [native Checkpoint/Restore In Userspace](http://blog.kubernetes.io/2015/07/how-did-quake-demo-from-dockercon-work.html) looks like the best way to accomplish this.
2221
* **Support docker images pulled from private registries**
2322
* **Support integration testing in other languages/environments**. .NET and NodeJS seem like sensible options here.

Diff for: docs/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ TestContainers is distributed in a handful of Maven modules:
3434
* **testcontainers** for just core functionality and generic containers support
3535
* **mysql**, **postgresql** or **oracle-xe** for database container support
3636
* **selenium** for selenium/webdriver support
37-
* **docker-compose** for Docker Compose support (in v.0.9.8, not yet released)
37+
* **docker-compose** for Docker Compose support
3838
* **nginx** for nginx container support
3939

4040
In the dependency description below, replace `--artifact name--` as appropriate:
4141

4242
<dependency>
4343
<groupId>org.testcontainers</groupId>
4444
<artifactId>--artifact name--</artifactId>
45-
<version>0.9.7</version>
45+
<version>0.9.8</version>
4646
</dependency>
4747

4848
> **Note**: Testcontainers uses the docker-java client library, which in turn depends on JAX-RS and various Jersey

Diff for: docs/usage/docker_compose.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Docker Compose
22

3-
> Note this will be in v0.9.8, which is not yet released
4-
53
## Benefits
64

75
Similar to [generic containers](generic_containers) support, it's also possible to run a bespoke set of services

Diff for: docs/usage/webdriver_containers.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ every test.
2222
The following field in your JUnit UI test class will prepare a container running Chrome:
2323

2424
@Rule
25-
public BrowserWebDriverContainerRule chrome =
26-
new BrowserWebDriverContainerRule()
25+
public BrowserWebDriverContainer chrome =
26+
new BrowserWebDriverContainer()
2727
.withDesiredCapabilities(DesiredCapabilities.chrome());
2828

2929
Now, instead of instantiating an instance of WebDriver directly, use the following to obtain an instance inside your
@@ -45,12 +45,12 @@ Docker container can reach. Use the `getHostIpAddress()` method, e.g.:
4545

4646
At the moment, Chrome and Firefox are supported. To switch, simply change the first parameter to the rule constructor:
4747

48-
new BrowserWebDriverContainerRule(
48+
new BrowserWebDriverContainer()
4949
.withDesiredCapabilities(DesiredCapabilities.chrome());
5050
5151
or
5252

53-
new BrowserWebDriverContainerRule(
53+
new BrowserWebDriverContainer()
5454
.withDesiredCapabilities(DesiredCapabilities.firefox());
5555

5656
### Recording videos
@@ -60,18 +60,18 @@ just for failing tests.
6060

6161
To do this, simply add extra parameters to the rule constructor:
6262

63-
new BrowserWebDriverContainerRule(
63+
new BrowserWebDriverContainer()
6464
.withDesiredCapabilities(DesiredCapabilities.chrome())
6565
.withRecordingMode(VncRecordingMode.RECORD_ALL, new File("./target/"))
6666

6767
or if you only want videos for test failures:
6868

69-
new BrowserWebDriverContainerRule(
69+
new BrowserWebDriverContainer()
7070
.withDesiredCapabilities(DesiredCapabilities.chrome())
7171
.withRecordingMode(VncRecordingMode.RECORD_FAILING, new File("./target/"))
7272

7373
Note that the seconds parameter to `withRecordingMode` should be a directory where recordings can be saved.
7474

7575
## More examples
7676

77-
A few different examples are shown in [SimpleWebDriverContainerTest.java](https://github.com/testcontainers/testcontainers-java/blob/master/modules/selenium/src/test/java/org/testcontainers/junit/SimpleWebDriverContainerTest.java).
77+
A few different examples are shown in [ChromeWebDriverContainerTest.java](https://github.com/testcontainers/testcontainers-java/blob/master/modules/selenium/src/test/java/org/testcontainers/junit/ChromeWebDriverContainerTest.java).

Diff for: modules/selenium/src/test/java/org/testcontainers/junit/BaseWebDriverContainerTest.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package org.testcontainers.junit;
22

3+
import org.jetbrains.annotations.NotNull;
34
import org.openqa.selenium.By;
45
import org.openqa.selenium.WebElement;
56
import org.openqa.selenium.remote.RemoteWebDriver;
67
import org.testcontainers.containers.BrowserWebDriverContainer;
78

89
import java.util.List;
910
import java.util.Random;
11+
import java.util.concurrent.TimeUnit;
1012

1113
import static org.rnorth.visibleassertions.VisibleAssertions.assertEquals;
1214

@@ -16,7 +18,7 @@
1618
public class BaseWebDriverContainerTest {
1719

1820
protected void doSimpleWebdriverTest(BrowserWebDriverContainer rule) {
19-
RemoteWebDriver driver = rule.getWebDriver();
21+
RemoteWebDriver driver = setupDriverFromRule(rule);
2022
System.out.println("Selenium remote URL is: " + rule.getSeleniumAddress());
2123
System.out.println("VNC URL is: " + rule.getVncAddress());
2224

@@ -28,8 +30,15 @@ protected void doSimpleWebdriverTest(BrowserWebDriverContainer rule) {
2830
assertEquals("the word 'testcontainers' appears in the search box", "testcontainers", driver.findElement(By.name("q")).getAttribute("value"));
2931
}
3032

31-
protected void doSimpleExplore(BrowserWebDriverContainer rule) {
33+
@NotNull
34+
private RemoteWebDriver setupDriverFromRule(BrowserWebDriverContainer rule) {
3235
RemoteWebDriver driver = rule.getWebDriver();
36+
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
37+
return driver;
38+
}
39+
40+
protected void doSimpleExplore(BrowserWebDriverContainer rule) {
41+
RemoteWebDriver driver = setupDriverFromRule(rule);
3342
driver.get("http://en.wikipedia.org/wiki/Randomness");
3443

3544
loop:

0 commit comments

Comments
 (0)