mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 06:23:52 +08:00
@@ -232,18 +232,17 @@ type WebSocketAction struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initWebSocket(testcase *TestCase) {
|
func initWebSocket(testcase *TestCase) {
|
||||||
tCase := testcase.ToTCase()
|
for _, step := range testcase.TestSteps {
|
||||||
for _, step := range tCase.TestSteps {
|
if step.Struct().WebSocket == nil {
|
||||||
if step.WebSocket == nil {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// init websocket action parameters
|
// init websocket action parameters
|
||||||
if step.WebSocket.Timeout <= 0 {
|
if step.Struct().WebSocket.Timeout <= 0 {
|
||||||
step.WebSocket.Timeout = defaultTimeout
|
step.Struct().WebSocket.Timeout = defaultTimeout
|
||||||
}
|
}
|
||||||
// close status code range: [1000, 4999]. ref: https://datatracker.ietf.org/doc/html/rfc6455#section-11.7
|
// close status code range: [1000, 4999]. ref: https://datatracker.ietf.org/doc/html/rfc6455#section-11.7
|
||||||
if step.WebSocket.CloseStatusCode < 1000 || step.WebSocket.CloseStatusCode > 4999 {
|
if step.Struct().WebSocket.CloseStatusCode < 1000 || step.Struct().WebSocket.CloseStatusCode > 4999 {
|
||||||
step.WebSocket.CloseStatusCode = defaultCloseStatus
|
step.Struct().WebSocket.CloseStatusCode = defaultCloseStatus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user