Skip to content

Commit a1926f0

Browse files
committed
Run GridTNG end to end tests using netty
1 parent 480a5ad commit a1926f0

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

java/server/test/org/openqa/selenium/grid/router/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ java_test_suite(
2727
"//java/server/src/org/openqa/selenium/grid/sessionmap/remote",
2828
"//java/server/src/org/openqa/selenium/grid/web",
2929
"//java/server/src/org/openqa/selenium/jetty/server",
30+
"//java/server/src/org/openqa/selenium/netty/server",
3031
"//java/server/test/org/openqa/selenium/grid/testing",
3132
"//third_party/java/assertj",
3233
"//third_party/java/guava",

java/server/test/org/openqa/selenium/grid/router/EndToEndTest.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.openqa.selenium.grid.node.SessionFactory;
3939
import org.openqa.selenium.grid.node.local.LocalNode;
4040
import org.openqa.selenium.grid.server.BaseServerOptions;
41-
import org.openqa.selenium.jetty.server.JettyServer;
4241
import org.openqa.selenium.grid.server.Server;
4342
import org.openqa.selenium.grid.sessionmap.SessionMap;
4443
import org.openqa.selenium.grid.sessionmap.local.LocalSessionMap;
@@ -49,6 +48,7 @@
4948
import org.openqa.selenium.grid.web.Values;
5049
import org.openqa.selenium.json.Json;
5150
import org.openqa.selenium.net.PortProber;
51+
import org.openqa.selenium.netty.server.NettyServer;
5252
import org.openqa.selenium.remote.RemoteWebDriver;
5353
import org.openqa.selenium.remote.SessionId;
5454
import org.openqa.selenium.remote.http.HttpClient;
@@ -185,7 +185,7 @@ private static Object[] createRemotes() throws URISyntaxException {
185185
LocalNode localNode = LocalNode.builder(bus, clientFactory, nodeUri)
186186
.add(CAPS, createFactory(nodeUri))
187187
.build();
188-
Server<?> nodeServer = new JettyServer(
188+
Server<?> nodeServer = new NettyServer(
189189
new BaseServerOptions(
190190
new MapConfig(ImmutableMap.of("server", ImmutableMap.of("port", port)))),
191191
localNode);
@@ -202,7 +202,8 @@ private static Object[] createRemotes() throws URISyntaxException {
202202

203203
private static Server<?> createServer(HttpHandler handler) {
204204
int port = PortProber.findFreePort();
205-
return new JettyServer(new BaseServerOptions(
205+
return new NettyServer(
206+
new BaseServerOptions(
206207
new MapConfig(ImmutableMap.of("server", ImmutableMap.of("port", port)))),
207208
handler);
208209
}
@@ -223,6 +224,17 @@ public HttpResponse execute(HttpRequest req) throws UncheckedIOException {
223224
return new TestSessionFactory((id, caps) -> new SpoofSession(caps));
224225
}
225226

227+
@Test
228+
public void success() {
229+
// The node added only has a single node. Make sure we can start and stop sessions.
230+
Capabilities caps = new ImmutableCapabilities("browserName", "cheese", "type", "cheddar");
231+
WebDriver driver = new RemoteWebDriver(server.getUrl(), caps);
232+
driver.get("http://www.google.com");
233+
234+
// Kill the session, and wait until the grid says it's ready
235+
driver.quit();
236+
}
237+
226238
@Test
227239
public void exerciseDriver() {
228240
// The node added only has a single node. Make sure we can start and stop sessions.

0 commit comments

Comments
 (0)