|
35 | 35 | import org.openqa.selenium.events.local.GuavaEventBus;
|
36 | 36 | import org.openqa.selenium.grid.data.Session;
|
37 | 37 | import org.openqa.selenium.grid.node.local.LocalNode;
|
38 |
| -import org.openqa.selenium.grid.node.locators.ById; |
39 | 38 | import org.openqa.selenium.grid.security.Secret;
|
40 | 39 | import org.openqa.selenium.grid.testing.TestSessionFactory;
|
41 | 40 | import org.openqa.selenium.grid.web.Values;
|
@@ -249,35 +248,6 @@ public By createBy(Object usingParameter) {
|
249 | 248 | assertThat(seenId).isEqualTo(elementId);
|
250 | 249 | }
|
251 | 250 |
|
252 |
| - @Test |
253 |
| - void shouldFallbackToUseById() { |
254 |
| - String elementId = UUID.randomUUID().toString(); |
255 |
| - |
256 |
| - Node node = Mockito.mock(Node.class); |
257 |
| - when(node.executeWebDriverCommand(argThat(matchesUri("/session/{sessionId}/elements")))) |
258 |
| - .thenReturn( |
259 |
| - new HttpResponse() |
260 |
| - .addHeader("Content-Type", Json.JSON_UTF_8) |
261 |
| - .setContent(Contents.asJson(singletonMap( |
262 |
| - "value", singletonList(singletonMap(Dialect.W3C.getEncodedElementKey(), elementId)))))); |
263 |
| - |
264 |
| - HttpHandler handler = new CustomLocatorHandler( |
265 |
| - node, |
266 |
| - registrationSecret, |
267 |
| - singleton(new ById())); |
268 |
| - |
269 |
| - HttpResponse res = handler.execute( |
270 |
| - new HttpRequest(POST, "/session/1234/elements") |
271 |
| - .setContent(Contents.asJson(ImmutableMap.of( |
272 |
| - "using", "id", |
273 |
| - "value", "tasty")))); |
274 |
| - |
275 |
| - List<Map<String, Object>> elements = Values.get(res, new TypeToken<List<Map<String, Object>>>(){}.getType()); |
276 |
| - assertThat(elements).hasSize(1); |
277 |
| - Object seenId = elements.get(0).get(Dialect.W3C.getEncodedElementKey()); |
278 |
| - assertThat(seenId).isEqualTo(elementId); |
279 |
| - } |
280 |
| - |
281 | 251 | private ArgumentMatcher<HttpRequest> matchesUri(String template) {
|
282 | 252 | UrlTemplate ut = new UrlTemplate(template);
|
283 | 253 |
|
|
0 commit comments