@@ -315,6 +315,41 @@ void seVncCdpUrlCapabilityWhenGridUrlWithSubPath() throws URISyntaxException {
315
315
assertThat (seCdp .toString ().contains (gridUrl .replace ("http" , "ws" ))).isTrue ();
316
316
}
317
317
318
+ @ Test
319
+ void seVncCdpUrlCapabilityWhenGridUrlWithTrailingSlash () throws URISyntaxException {
320
+ Tracer tracer = DefaultTestTracer .createTracer ();
321
+ EventBus bus = new GuavaEventBus ();
322
+ URI uri = new URI ("https://my.domain.com/" );
323
+ Capabilities stereotype =
324
+ new ImmutableCapabilities (
325
+ "se:vncLocalAddress" , "ws://localhost:7900" ,
326
+ "se:cdp" , "ws://localhost:9222/devtools/browser/1a2b3c4d5e6f" );
327
+
328
+ LocalNode .Builder builder =
329
+ LocalNode .builder (tracer , bus , uri , uri , registrationSecret )
330
+ .enableCdp (true )
331
+ .add (
332
+ stereotype ,
333
+ new TestSessionFactory (
334
+ (id , caps ) -> new Session (id , uri , stereotype , caps , Instant .now ())));
335
+ LocalNode localNode = builder .build ();
336
+
337
+ Either <WebDriverException , CreateSessionResponse > response =
338
+ localNode .newSession (
339
+ new CreateSessionRequest (ImmutableSet .of (W3C ), stereotype , ImmutableMap .of ()));
340
+ assertThat (response .isRight ()).isTrue ();
341
+
342
+ CreateSessionResponse sessionResponse = response .right ();
343
+ Capabilities capabilities = sessionResponse .getSession ().getCapabilities ();
344
+ Object seVnc = capabilities .getCapability ("se:vnc" );
345
+ assertThat (seVnc ).isNotNull ();
346
+ assertThat (seVnc .toString ().contains ("wss://my.domain.com/session" )).isTrue ();
347
+
348
+ Object seCdp = capabilities .getCapability ("se:cdp" );
349
+ assertThat (seCdp ).isNotNull ();
350
+ assertThat (seCdp .toString ().contains ("wss://my.domain.com/session" )).isTrue ();
351
+ }
352
+
318
353
@ Test
319
354
void cdpIsDisabledAndResponseCapsShowThat () throws URISyntaxException {
320
355
Tracer tracer = DefaultTestTracer .createTracer ();
0 commit comments