-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve #326, making browser container startup timeout configurable.
Reduces default browser container startup timeout to 15s, down from an unnecessarily high 120s. This also replaces inheritance-based `waitUntilContainerStarted` with composition-based `WaitStrategy`. The new `LogMessageWaitStrategy` allows us to wait based upon the Selenium container log output, rather than the relatively expensive process of repeatedly trying to create and connect a `RemoteWebDriver` instance.
- Loading branch information
Showing
3 changed files
with
44 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...enium/src/test/java/org/testcontainers/junit/CustomWaitTimeoutWebDriverContainerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.testcontainers.junit; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
import org.testcontainers.containers.BrowserWebDriverContainer; | ||
|
||
import java.io.IOException; | ||
import java.time.Duration; | ||
|
||
import static java.time.temporal.ChronoUnit.SECONDS; | ||
|
||
/** | ||
* | ||
*/ | ||
public class CustomWaitTimeoutWebDriverContainerTest extends BaseWebDriverContainerTest { | ||
|
||
@Rule | ||
public BrowserWebDriverContainer chromeWithCustomTimeout = new BrowserWebDriverContainer<>() | ||
.withDesiredCapabilities(DesiredCapabilities.chrome()) | ||
.withStartupTimeout(Duration.of(30, SECONDS)); | ||
|
||
@Test | ||
public void simpleTest() throws IOException { | ||
doSimpleWebdriverTest(chromeWithCustomTimeout); | ||
} | ||
} |