RhinoJS 支持 websockets API 吗?
我一直在使用 Jasmine 为 Web 应用程序编写 BDD 测试。我有兴趣使用 Rhino 从命令行运行这些相同的测试,我发现了这个 博客文章非常有帮助。然而;我的应用程序使用 pusher,它提供了一个简单的 API,用于使用 Web 套接字在客户端之间传递事件。
我的测试在浏览器中运行良好,但通过 Rhino 运行它们无法连接到推送器。 Pusher 提供了一个调试流,它会显示身份验证错误或其他失败,但当我从命令行运行测试时,它不会注册任何活动。
这可能是一个简单的是或否的答案,但我无法找到任何相关文档,而且我对 Rhino 是全新的,所以如果这是一个完全 n00b 的问题,我深表歉意。
我的问题
正如标题所说,有谁知道Rhino是否支持websockets API?我是否在这里做错了什么,或者依赖于 websocket 的脚本根本无法通过 Rhino 运行?
我的总体目标是使用我已经编写的 jasmine 测试作为压力测试,同时在多个 EC2 实例上运行它们;有没有一种好的(简单的?)方法可以在重用我现有的 javascript 测试的同时做到这一点,或者我应该接受它并用服务器端脚本语言编写我的压力测试?我知道硒网格,但希望避免生成新的浏览器来运行这些测试,如果可能的话。
非常感谢!
I have been using Jasmine to write BDD tests for a web app. I am interested in running these same tests from the command line using Rhino, and I found this blog entry which has been very helpful. However; my app uses pusher, which offers a simple API for passing events between clients using web sockets.
My tests run fine from a browser, but running them via Rhino fails to connect to pusher. Pusher offers a debug stream, and it would show authentication errors or other failures, but it doesn't register any activity when I run my tests from the command line.
This may be a simple yes or no answer, but I haven't been able to locate any relevant documentation, and I'm brand new to Rhino so I apologize if this is a total n00b question.
My question
As the title says, does anyone know if Rhino supports the websockets API? Am I doing something else wrong here, or will scripts that rely on websockets simply not work via Rhino?
My overall goal was to use my already written jasmine tests as stress tests by running them on several EC2 instances at once; is there a good (simple?) way to do this while reusing my existing javascript tests, or should I suck it up and just write my stress tests in a server side scripting language? I am aware of selenium grid, but was hoping to avoid having to spawn new browsers to run these tests, if possible.
Thanks so much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ringo,一个基于 Rhino 的 CommonJS 运行时支持它们:http://ringojs.org/api/v0。 6/ringo/webapp/websocket/
Ringo, a Rhino-based CommonJS runtime supports them: http://ringojs.org/api/v0.6/ringo/webapp/websocket/