Skip to content

Commit

Permalink
Modify Selenium container startup detection (#351)
Browse files Browse the repository at this point in the history
* Modify Selenium container startup detection, using alternative readiness string observed in v3.x of Selenium containers.

* Simplify string

* Revert simplification (needed for 2.45.0)

* Update test following comments
  • Loading branch information
rnorth committed Jun 3, 2017
1 parent 51a3a56 commit 0569e0b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class BrowserWebDriverContainer<SELF extends BrowserWebDriverContainer<SE
*/
public BrowserWebDriverContainer() {
this.waitStrategy = new LogMessageWaitStrategy()
.withRegEx(".*RemoteWebDriver instances should connect to.*\n")
.withRegEx(".*(RemoteWebDriver instances should connect to|Selenium Server is up and running).*\n")
.withStartupTimeout(Duration.of(15, SECONDS));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.testcontainers.junit;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testcontainers.containers.BrowserWebDriverContainer;

/**
* Simple test to check that readiness detection works correctly across major versions of the containers.
*/
@RunWith(Parameterized.class)
public class Selenium3xTest {

@Parameterized.Parameters(name = "tag: {0}")
public static String[] data() {
return new String[]{"3.4.0", "2.53.0", "2.45.0"};
}

@Parameterized.Parameter()
public String tag;

@Test
public void testAdditionalStartupString() {
try (BrowserWebDriverContainer chrome = new BrowserWebDriverContainer("selenium/standalone-chrome-debug:" + tag)
.withDesiredCapabilities(DesiredCapabilities.chrome())) {
chrome.start();
}
}
}

0 comments on commit 0569e0b

Please sign in to comment.