This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 19
19
</repositories >
20
20
21
21
<properties >
22
- <version .selenium>3.7 .1</version .selenium>
22
+ <version .selenium>3.8 .1</version .selenium>
23
23
</properties >
24
24
25
25
<dependencies >
Original file line number Diff line number Diff line change 58
58
import org .openqa .grid .internal .listeners .TestSessionListener ;
59
59
import org .openqa .grid .selenium .proxy .DefaultRemoteProxy ;
60
60
import org .openqa .selenium .remote .CapabilityType ;
61
+ import org .openqa .selenium .remote .server .jmx .ManagedService ;
61
62
62
63
import javax .servlet .http .HttpServletRequest ;
63
64
import javax .servlet .http .HttpServletResponse ;
69
70
import java .util .concurrent .ExecutionException ;
70
71
import java .util .concurrent .Future ;
71
72
72
-
73
+ @ ManagedService ( description = "Selenium-Grid-Extras SetupTeardownProxy" )
73
74
public class SetupTeardownProxy extends DefaultRemoteProxy implements TestSessionListener {
74
75
75
76
private boolean available = true ;
@@ -107,7 +108,7 @@ public TestSession getNewSession(Map<String, Object> requestedCapability) {
107
108
108
109
String host = session .getSlot ().getRemoteURL ().getHost ();
109
110
int port = getNodeExtrasPort (session );
110
-
111
+
111
112
logNewSessionHistoryAsync (session );
112
113
113
114
CommonThreadPool .startCallable (
@@ -304,10 +305,10 @@ public static Future<String> logNewSessionHistoryAsync(TestSession session) {
304
305
}
305
306
return null ;
306
307
}
307
-
308
+
308
309
public static int getNodeExtrasPort (TestSession session ){
309
310
try {
310
-
311
+
311
312
String port = session .getSlot ().getProxy ().getConfig ().custom .get (Config .GRID_EXTRAS_PORT );
312
313
if (port != null || ! port .equals ("" )) {
313
314
return Integer .parseInt (port );
Original file line number Diff line number Diff line change 7
7
import com .groupon .seleniumgridextras .config .RuntimeConfig ;
8
8
import com .groupon .seleniumgridextras .config .capabilities .BrowserType ;
9
9
import com .groupon .seleniumgridextras .grid .proxies .SetupTeardownProxy ;
10
+ import com .groupon .seleniumgridextras .loggers .SessionHistoryLog ;
11
+
10
12
import org .apache .commons .io .FileUtils ;
11
13
import org .junit .After ;
12
14
import org .junit .Assert ;
19
21
20
22
import java .io .File ;
21
23
import java .net .URL ;
24
+ import java .util .HashMap ;
25
+ import java .util .Map ;
22
26
import java .util .UUID ;
23
27
import java .util .concurrent .Future ;
24
28
@@ -85,6 +89,12 @@ public void testLogSessionWithSessionHistoryEnabled() throws Exception {
85
89
Assert .assertTrue (!Strings .isNullOrEmpty (result ));
86
90
87
91
File sessionLogDir = DefaultConfig .SESSION_LOG_DIRECTORY ;
92
+ SessionHistoryLog .setOutputDir (sessionLogDir );
93
+ Map sessionInfo = new HashMap ();
94
+ sessionInfo .put ("id" , "123456" );
95
+ sessionInfo .put ("stuff" , "stuff" );
96
+ SessionHistoryLog .newSession ("node" , sessionInfo );
97
+
88
98
Assert .assertTrue ("Expect the session log directory to exist!" , sessionLogDir .exists ());
89
99
Assert .assertTrue ("Expect the session log directory to be a directory!" , sessionLogDir .isDirectory ());
90
100
Assert .assertTrue ("Expect the session log directory to have a file!" , sessionLogDir .list ().length > 0 );
You can’t perform that action at this time.
0 commit comments