|
18 | 18 | package org.openqa.selenium.testing.drivers; |
19 | 19 |
|
20 | 20 | import org.openqa.selenium.Platform; |
| 21 | +import org.openqa.selenium.build.BazelBuild; |
| 22 | +import org.openqa.selenium.build.DevMode; |
| 23 | +import org.openqa.selenium.build.InProject; |
21 | 24 | import org.openqa.selenium.net.NetworkUtils; |
22 | 25 | import org.openqa.selenium.net.PortProber; |
23 | 26 | import org.openqa.selenium.net.UrlChecker; |
|
26 | 29 | import java.io.File; |
27 | 30 | import java.net.MalformedURLException; |
28 | 31 | import java.net.URL; |
| 32 | +import java.nio.file.Path; |
29 | 33 | import java.util.logging.Logger; |
30 | 34 | import java.util.stream.Stream; |
31 | 35 |
|
@@ -77,7 +81,7 @@ public OutOfProcessSeleniumServer start(String mode, String... extraFlags) { |
77 | 81 | try { |
78 | 82 | URL url = new URL(baseUrl + "/status"); |
79 | 83 | log.info("Waiting for server status on URL " + url); |
80 | | - new UrlChecker().waitUntilAvailable(5, SECONDS, url); |
| 84 | + new UrlChecker().waitUntilAvailable(10, SECONDS, url); |
81 | 85 | log.info("Server is ready"); |
82 | 86 | } catch (UrlChecker.TimeoutException e) { |
83 | 87 | log.severe("Server failed to start: " + e.getMessage()); |
@@ -113,6 +117,19 @@ public void stop() { |
113 | 117 | } |
114 | 118 |
|
115 | 119 | private String buildServerAndClasspath() { |
| 120 | + if (DevMode.isInDevMode()) { |
| 121 | + Path serverJar = InProject.locate( |
| 122 | + "bazel-bin/java/server/src/org/openqa/selenium/grid/selenium_server_deploy.jar"); |
| 123 | + if (serverJar == null) { |
| 124 | + new BazelBuild().build("grid"); |
| 125 | + serverJar = InProject.locate( |
| 126 | + "bazel-bin/java/server/src/org/openqa/selenium/grid/selenium_server_deploy.jar"); |
| 127 | + } |
| 128 | + if (serverJar != null) { |
| 129 | + return serverJar.toAbsolutePath().toString(); |
| 130 | + } |
| 131 | + } |
| 132 | + |
116 | 133 | if (System.getProperty("selenium.browser.remote.path") != null) { |
117 | 134 | return System.getProperty("selenium.browser.remote.path"); |
118 | 135 | } |
|
0 commit comments