Skip to content

Commit 1c98bd5

Browse files
committed
Add a test to make sure screenshots are added to exceptions
1 parent 17fbc03 commit 1c98bd5

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

java/server/test/org/openqa/selenium/remote/server/RemoteServerTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.openqa.selenium.remote.server.handler.UploadFileTest;
2424
import org.openqa.selenium.remote.server.handler.html5.UtilsTest;
2525
import org.openqa.selenium.remote.server.handler.interactions.SendKeyToActiveElementTest;
26+
import org.openqa.selenium.remote.server.rest.ResponsesTest;
2627
import org.openqa.selenium.remote.server.rest.ResultConfigTest;
2728
import org.openqa.selenium.remote.server.xdrpc.CrossDomainRpcLoaderTest;
2829

@@ -32,21 +33,22 @@
3233
ActiveSessionFactoryTest.class,
3334
AllHandlersTest.class,
3435
CapabilitiesComparatorTest.class,
36+
ConfigureTimeoutTest.class,
3537
CrossDomainRpcLoaderTest.class,
3638
DefaultSessionTest.class,
3739
DriverFactoryTest.class,
3840
NewSessionPayloadTest.class,
3941
NewSessionPipelineTest.class,
4042
PassthroughTest.class,
4143
ProtocolConverterTest.class,
44+
ResponsesTest.class,
4245
ResultConfigTest.class,
4346
SendKeyToActiveElementTest.class,
4447
SessionLogsTest.class,
4548
SyntheticNewSessionPayloadTest.class,
4649
TeeReaderTest.class,
4750
UploadFileTest.class,
4851
org.openqa.selenium.remote.server.commandhandler.UploadFileTest.class,
49-
ConfigureTimeoutTest.class,
5052
UrlTemplateTest.class,
5153
UtilsTest.class,
5254
WebDriverServletTest.class
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Licensed to the Software Freedom Conservancy (SFC) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The SFC licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package org.openqa.selenium.remote.server.rest;
19+
20+
import static org.junit.Assert.*;
21+
22+
import org.junit.Test;
23+
import org.openqa.selenium.remote.Response;
24+
import org.openqa.selenium.remote.SessionId;
25+
26+
import java.util.Optional;
27+
28+
public class ResponsesTest {
29+
30+
@Test
31+
public void shouldAddScreenshotIfPresent() {
32+
Response response = Responses.failure(
33+
new SessionId("cheese"),
34+
new RuntimeException("boo"),
35+
Optional.of("hello"));
36+
37+
System.out.println("response = " + response);
38+
}
39+
40+
}

0 commit comments

Comments
 (0)