@@ -100,10 +100,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
100
100
}
101
101
}
102
102
` ),
103
- browserName : "chrome" ,
104
- sessionBrowserName : "chrome" ,
105
- browserVersion : "" ,
106
- platformName : "linux" ,
103
+ browserName : "chrome" ,
104
+ sessionBrowserName : "chrome" ,
105
+ browserVersion : "" ,
106
+ enableManagedDownloads : true ,
107
+ platformName : "linux" ,
107
108
},
108
109
wantNewRequestNodes : 4 ,
109
110
wantOnGoingSessions : 0 ,
@@ -276,10 +277,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
276
277
}
277
278
}
278
279
` ),
279
- browserName : "firefox" ,
280
- sessionBrowserName : "firefox" ,
281
- browserVersion : "" ,
282
- platformName : "linux" ,
280
+ browserName : "firefox" ,
281
+ sessionBrowserName : "firefox" ,
282
+ browserVersion : "" ,
283
+ enableManagedDownloads : true ,
284
+ platformName : "linux" ,
283
285
},
284
286
wantNewRequestNodes : 0 ,
285
287
wantOnGoingSessions : 4 ,
@@ -326,10 +328,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
326
328
}
327
329
}
328
330
` ),
329
- browserName : "chrome" ,
330
- sessionBrowserName : "chrome" ,
331
- browserVersion : "" ,
332
- platformName : "linux" ,
331
+ browserName : "chrome" ,
332
+ sessionBrowserName : "chrome" ,
333
+ browserVersion : "" ,
334
+ enableManagedDownloads : true ,
335
+ platformName : "linux" ,
333
336
},
334
337
wantNewRequestNodes : 1 ,
335
338
wantOnGoingSessions : 0 ,
@@ -1909,7 +1912,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
1909
1912
wantErr : false ,
1910
1913
},
1911
1914
{
1912
- name : "4_sessions_requests_with_matching_browserName_and_platformName_when_set_nodeMaxSessions_2_and_3_requests_match_should_return_count_as_1_and_1_ongoing_session " ,
1915
+ name : "4_sessions_requests_with_matching_browserName_and_platformName_when_set_nodeMaxSessions_2_and_4_requests_match_should_return_count_as_2_and_1_ongoing_session " ,
1913
1916
args : args {
1914
1917
b : []byte (`{
1915
1918
"data": {
@@ -1957,10 +1960,62 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
1957
1960
nodeMaxSessions : 2 ,
1958
1961
enableManagedDownloads : true ,
1959
1962
},
1960
- wantNewRequestNodes : 1 ,
1963
+ wantNewRequestNodes : 2 ,
1961
1964
wantOnGoingSessions : 1 ,
1962
1965
wantErr : false ,
1963
1966
},
1967
+ {
1968
+ name : "4_sessions_requests_with_matching_browserName_and_platformName_when_set_nodeMaxSessions_2_disable_managed_downloads_and_1_requests_match_should_return_count_as_1_and_0_ongoing_session" ,
1969
+ args : args {
1970
+ b : []byte (`{
1971
+ "data": {
1972
+ "grid": {
1973
+ "sessionCount": 1,
1974
+ "maxSession": 2,
1975
+ "totalSlots": 2
1976
+ },
1977
+ "nodesInfo": {
1978
+ "nodes": [
1979
+ {
1980
+ "id": "node-1",
1981
+ "status": "UP",
1982
+ "sessionCount": 1,
1983
+ "maxSession": 1,
1984
+ "slotCount": 1,
1985
+ "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"se:downloadsEnabled\": true}}]",
1986
+ "sessions": [
1987
+ {
1988
+ "id": "session-1",
1989
+ "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"se:downloadsEnabled\": true}",
1990
+ "slot": {
1991
+ "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64",
1992
+ "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"se:downloadsEnabled\": true}"
1993
+ }
1994
+ }
1995
+ ]
1996
+ }
1997
+ ]
1998
+ },
1999
+ "sessionsInfo": {
2000
+ "sessionQueueRequests": [
2001
+ "{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
2002
+ "{\n \"browserName\": \"chrome\",\n \"se:downloadsEnabled\": true,\n \"platformName\": \"linux\"\n}",
2003
+ "{\n \"browserName\": \"chrome\",\n \"se:downloadsEnabled\": true,\n \"platformName\": \"linux\"\n}",
2004
+ "{\n \"browserName\": \"chrome\",\n \"se:downloadsEnabled\": true,\n \"platformName\": \"linux\"\n}",
2005
+ "{\n \"browserName\": \"chrome\",\n \"platformName\": \"Windows 11\"\n}"]
2006
+ }
2007
+ }
2008
+ }` ),
2009
+ browserName : "chrome" ,
2010
+ sessionBrowserName : "chrome" ,
2011
+ browserVersion : "" ,
2012
+ platformName : "linux" ,
2013
+ nodeMaxSessions : 2 ,
2014
+ },
2015
+ wantNewRequestNodes : 1 ,
2016
+ wantOnGoingSessions : 0 ,
2017
+ wantErr : false ,
2018
+ },
1964
2019
{
1965
2020
name : "4_sessions_requests_with_matching_browserName_and_platformName_when_set_extra_capabilities_and_2_requests_match_should_return_count_as_2_and_ongoing_1" ,
1966
2021
args : args {
@@ -2015,7 +2070,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
2015
2070
wantErr : false ,
2016
2071
},
2017
2072
{
2018
- name : "4_sessions_requests_with_matching_browserName_and_platformName_when_set_extra_capabilities_and_mangaged_downloads_and_1_request_match_should_return_count_as_1_and_ongoing_1 " ,
2073
+ name : "4_sessions_requests_with_matching_browserName_and_platformName_when_set_extra_capabilities_and_mangaged_downloads_and_1_request_match_should_return_count_as_2_and_ongoing_1 " ,
2019
2074
args : args {
2020
2075
b : []byte (`{
2021
2076
"data": {
@@ -2064,10 +2119,81 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
2064
2119
enableManagedDownloads : true ,
2065
2120
capabilities : "{\" myApp:version\" : \" beta\" , \" myApp:scope\" : \" internal\" }" ,
2066
2121
},
2067
- wantNewRequestNodes : 1 ,
2122
+ wantNewRequestNodes : 2 ,
2068
2123
wantOnGoingSessions : 1 ,
2069
2124
wantErr : false ,
2070
2125
},
2126
+ {
2127
+ name : "4_sessions_requests_with_matching_browserName_and_platformName_when_set_extra_capabilities_and_mangaged_downloads_and_4_request_match_should_return_count_as_4_and_ongoing_2" ,
2128
+ args : args {
2129
+ b : []byte (`{
2130
+ "data": {
2131
+ "grid": {
2132
+ "sessionCount": 1,
2133
+ "maxSession": 1,
2134
+ "totalSlots": 1
2135
+ },
2136
+ "nodesInfo": {
2137
+ "nodes": [
2138
+ {
2139
+ "id": "node-1",
2140
+ "status": "UP",
2141
+ "sessionCount": 1,
2142
+ "maxSession": 1,
2143
+ "slotCount": 1,
2144
+ "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"myApp:version\": \"beta\", \"myApp:scope\": \"internal\", \"se:downloadsEnabled\": true}}]",
2145
+ "sessions": [
2146
+ {
2147
+ "id": "session-1",
2148
+ "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"myApp:version\": \"beta\", \"myApp:scope\": \"internal\", \"se:downloadsEnabled\": true}",
2149
+ "slot": {
2150
+ "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64",
2151
+ "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"myApp:version\": \"beta\", \"myApp:scope\": \"internal\", \"se:downloadsEnabled\": true}"
2152
+ }
2153
+ }
2154
+ ]
2155
+ },
2156
+ {
2157
+ "id": "node-2",
2158
+ "status": "UP",
2159
+ "sessionCount": 1,
2160
+ "maxSession": 1,
2161
+ "slotCount": 1,
2162
+ "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"myApp:version\": \"beta\", \"myApp:scope\": \"internal\"}}]",
2163
+ "sessions": [
2164
+ {
2165
+ "id": "session-1",
2166
+ "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"myApp:version\": \"beta\", \"myApp:scope\": \"internal\"}",
2167
+ "slot": {
2168
+ "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64",
2169
+ "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\", \"myApp:version\": \"beta\", \"myApp:scope\": \"internal\"}"
2170
+ }
2171
+ }
2172
+ ]
2173
+ }
2174
+ ]
2175
+ },
2176
+ "sessionsInfo": {
2177
+ "sessionQueueRequests": [
2178
+ "{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
2179
+ "{\n \"browserName\": \"chrome\",\n \"myApp:version\": \"beta\",\n \"platformName\": \"linux\"\n}",
2180
+ "{\n \"browserName\": \"chrome\",\n \"myApp:version\": \"beta\",\n \"myApp:scope\": \"internal\",\n \"platformName\": \"linux\"\n}",
2181
+ "{\n \"browserName\": \"chrome\",\n \"myApp:version\": \"beta\",\n \"myApp:scope\": \"internal\",\n \"platformName\": \"linux\"\n}",
2182
+ "{\n \"browserName\": \"chrome\",\n \"platformName\": \"Windows 11\"\n}"]
2183
+ }
2184
+ }
2185
+ }` ),
2186
+ browserName : "chrome" ,
2187
+ sessionBrowserName : "chrome" ,
2188
+ browserVersion : "" ,
2189
+ platformName : "linux" ,
2190
+ nodeMaxSessions : 1 ,
2191
+ enableManagedDownloads : true ,
2192
+ },
2193
+ wantNewRequestNodes : 4 ,
2194
+ wantOnGoingSessions : 2 ,
2195
+ wantErr : false ,
2196
+ },
2071
2197
{
2072
2198
name : "Given_2_requests_include_1_without_browserVersion_When_scaler_metadata_explicit_name_version_platform_Then_scaler_should_scale_up_for_1_request_has_browserVersion_and_return_0_ongoing_sessions" ,
2073
2199
args : args {
0 commit comments