如何在空手道上集成 socket.io [英] How can I integrate socket.io on Karate

查看:24
本文介绍了如何在空手道上集成 socket.io的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道空手道内置了对 WebSocket 的支持,但无论如何可以在空手道上使用 socket.io?

I know that karate has a built-in support for WebSocket, but there is anyway that can use socket.io on karate?

我想将消息发送到与 socket.io 通信的微服务中,并等待响应以断言消息符合预期.

I would like to sent a message into a microservices that comunicate with socket.io, and wait the response for asserting that the message is as expected.

推荐答案

不,您不能使用来自 Karate 的任意 JavaScript 库,而且通常永远不需要.

No, you can't use arbitrary JavaScript libraries from Karate, and there is typically never a need to.

如果你解释你到底想做什么(你可以编辑你的问题),这将使讨论更有成效.空手道是一个测试框架.如果您发现 WebSockets 实现中存在差距,正确的做法是要求修复,请参见示例:https://github.com/intuit/karate/issues/775

if you explain what exactly you are trying to do (you can edit your question) that would make for a much more productive discussion. Karate is a testing framework. if you see a gap in the WebSockets implementation, the right thing to do is ask for a fix, see example: https://github.com/intuit/karate/issues/775

或者也许您需要做的就是使用 Java 互操作.我知道团队使用它来测试执行双向/异步流的 gRPC、JMS 消息传递和聊天机器人:https://twitter.com/KarateDSL/status/1128170638223364097

Or maybe all you need to do is use the Java inter-op. I know teams using this to test gRPC, JMS messaging and chat-bots that do bi-directional / async flows: https://twitter.com/KarateDSL/status/1128170638223364097

这篇关于如何在空手道上集成 socket.io的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆