Feature: Verification of wss connectivity of websocket infra test
Background:
* url jsonObj.baseUrl
* callonce read('classpath:common/Login.feature') {loginObj: jsonObj.accountinfo.login2}
@websocket
Scenario: Check subscription over wss
Given def notificationUrl = 'wss://my.test.domain.com/ui-notification/open/'
* def ws_headers = read('classpath:corejs/ws_headers.js')
* json options = { headers: '#(ws_headers)' }
And def handler = function(msg){ return msg.startsWith('{') }
And def socket = karate.webSocket(notificationUrl, handler, options)
Ожидается, что рукопожатие веб-сокета сработает, как и все файлы cookie авторизации, которые мы получаем из многократного вызова функции, т.е. вход в систему по своей сути доступен во всем объеме выполнения. Содержимое ws_headers. js
{
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9,sv;q=0.8',
'Cache-Control': 'no-cache',
'Connection': 'Upgrade',
'Host': 'my.test.domain.com',
'Origin': 'https://my.test.domain.com',
'Pragma': 'no-cache',
'Sec-WebSocket-Extensions': 'permessage-deflate; client_max_window_bits',
'Sec-WebSocket-Key': 'XdoghnpRGfqSj8yttPsY0w==',
'Sec-WebSocket-Version': '13',
'Upgrade': 'websocket'
}
Однако возникает следующее исключение. Есть ли способ получить более подробную информацию о том, что именно не дает «взломщика»?
javascript evaluation failed: karate.webSocket(notificationUrl, handler, options), io.netty.karate.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid handshake response getStatus: 302 Found